Ok I have a question about using state changes to remove a listener... What happens if you get an event when you are in the second state?
As an example, say you are in state1 with some listeners and a timer running, then jump to state2 to close them. In the instant before you jump back, the timer runs out and sends the script a timer event... What if something crazier happened and you got several events... the timer fired and someone touched it, and a collision occurred?
Stuff like that keeps me up at night.