This addresses a bit of thread unsafety mentioned in a comment, and fixes a 'ScheduleEvent_Threadsafe from main thread' message. To make this work nicely, make PauseAndLock call DeclareAsCPUThread - i.e. while you have the CPU thread locked, you can consider yourself the CPU thread.