Here is a bunch of registry functions I wrote.
It would be used like this
js code:
Registry_SetKeyValue(HKCU, MsgPlus.ScriptRegPath.substr(5), 'key', 'this is a test', REG_SZ);
Debug.Trace(Registry_GetKeyValue(HKCU, MsgPlus.ScriptRegPath.substr(5), 'key');