Gmail requires TLS/SSL to connect, which fortunately is trivial in mSL since it natively supports SSL sockets. You need to download and install the OpenSSL libraries. mIRC requires libeay32.dll and ssleay32.dll to be in $mircdir

$sslready can be used to check if SSL is available or not. Various SSL settings can be changed in the Connect/Options dialog and are available only if the OpenSSL libraries have been loaded successfully.

As far as changing the script, I'll leave that to the man whom wrote it. I would recommend going ahead however and installing OpenSSL and verifying it's working (in the Options as stated above, or //echo -a $sslready).