Merbo, you have it roughly backwards. the extra '$' will, if no value is returned, make mIRC abruptly end execution of the current routine without returning to the caller (it is precisely an implicit /halt without the side effect of /haltdef):
//echo -a * $?="Reason:" | echo -a next line
vs.
//echo -a * $$?="Reason:" | echo -a next line
the second will not proceed with the next echo if 'Cancel' is clicked.