When I tested your code, the script did halt whenever the variables were empty, but that was because of the "nick $null": mirc threw an error "* /nick: insufficient parameters" and halted (which is of course normal). If you are certain that such error message is not displayed, you might want to check if you have a /nick alias that uses $$1 (notice the double $) or includes an :error label followed by "reseterror | halt" (I don't see why one would do the latter intentionally, but the former is plausible).