If there is a global sandbox object equivlent to window in a normal JS environment, can it be an XPCNativeWrapper with getters for the GM_* APIs? Then wrapping each script in its own function and timeout should make the scripts completely independent.