Maybe because the game is doing canvas.setCanvas("MainMenuGUI"); after the RebindGUI pops up.
Try putting it on a schedule, you might also want to change that checking a little. Sorry.
if(movemap.getCommand(keyboard,f11) $= "")
movemap.bind(keyboard,f11,ToggleAutoClick);
else
canvas.pushdialog(RebindGUI);
Will cause the popup to come up even if it's ToggleAutoClick that's bound to f11, or even rebind ToggleAutoClick back to f11 if you change it and restart.
This can be fixed with a canvas.getBinding(command) check.
if(movemap.getBinding(ToggleAutoClick) $= "")
{
if(movemap.getCommand(keyboard,f11) $= "")
movemap.bind(keyboard,f11,ToggleAutoClick);
else
canvas.schedule(33,pushdialog,RebindGUI);
}
It checks if the command isn't bound yet, then tries to bind it to f11, and then calls the rebindgui if that fails on a delay so that it's not immediately closed.