Update ScriptUndoCommand to run on ScriptEngine thread