Ah, I just discovered PIL 25.2 (Hooks) and 25.4 (Sandboxing), so
perhaps debug.sethook() will be a good way to do this.
Though still interested in other solutions, if people have them.
-John
There is one detail you should be advised of. While this can be made to work, the hooks only work between operations. A single long-running operation (for example, an I/O operation or a call to a C function) does not trigger any Lua hooks and will therefore block this style of preemption.
/s/ Adam