Update
I am testing out declaring my main object in the global scope and attaching runtime to it as a parameter inside the boilerplate function runOnStartup.
I literally just did this seconds ago so will see if I find any issues from this. The main reason I needed this now is to call some functions setup in event sheets.
I have also attached the Sprite this logic is controlling in a parameter and that seems to be working fine. I pass it to my script from an 'On Layout Start' - on the layout this sprite is on.
In another case when I call a method from an event sheet I pass the instance 'picked' with the events, using getFirstPickedInstance().
So I am finding different ways to go about this that all seem to be working out fine right now.
As far as the tip to put scripts in an anonymous function, I don't believe I need that as I am using a runtime worker.
skymen, you can correct me if I'm wrong. Also, it isn't my biggest concern as this logic wouldn't really benefit any cheaters.