Threads executing a script should call this method at the start of execution
in order to set the id of the console that is hosting the thread of execution.
To use this, simply drop this as an UndoableEditListener into your document,
and then create actions to call undo/redo as needed (checking can undo/redo
first, of course).