Code
if ($input(GameGuard is on?,byw,GameGuard) == $false) halt


I added the 'b' switch so it puts a pause of 1 second, and also clears the buffer so it ignores a pending keystroke made before the dialog appears. You can take that out if you don't like it.