This is due to $unsafe which is a recent addition, it doesn't exist in 6.35, causing $chan and $1 to be $null.
Running script in 6.35 is a bad idea. The only valid reason for running 6.35 before was to able to use codepage still.
But recently mIRC added support back for codepage, so you can now use codepage on the latest version of mIRC, you have absolutely no reason to be using 6.35, for this reason I won't be giving you a replacement for $unsafe here, but if you have valid (read: you don't) argument as to why you're still using 6.35, I'll give you the replacement.