Helper function to retrieve a REG_DWORD value from the registry and
assign it to a variable, substituting a default value if the registry
entry is invalid or missing. The function is specifically tailored
toward setting a value in milliseconds, hence the name.