Since launchbox hooks the ESC key to quit the emulator, I used that process to restore the mouse. No loops needed.
; Move the mouse off the screen and block movement
MouseGetPos, mouse_x, mouse_y
MouseMove 9999,9999,0
BlockInput MouseMove
; This section closes Demul when pressing Escape
$Esc::
{
; Clos the emulator
Process, Close, {{{StartupEXE}}}
; Allow mouse to move and center it
BlockInput MouseMoveOff
MouseMove A_ScreenWidth/2,A_ScreenHeight/2, 0
}
... man does the no syntax highlighting suck...