There are a few methods of doing that, which I cannot recall, but I have a neater solution to that.

Make part of the script vital to the user... like drive mappings, come at the very end of the script.

The user may cancel the script, but then cannot work due to lack of network resources. Eventually the user will get tired of the game and leave the button alone