The $addtok line in the original posting, for some reason, was missing a ) at the end.
This has been corrected. Some of you may not have gotten noticed a problem with that, dependent on what version of mIRC you were using the code on.