I was trying to make a port scanner, but with this speed it will be very slow. =P
Well, mIRC is not for making port scanners, password crackers, bruteforcers. mIRC's speed is slow, and mIRC scripting is used to make your mIRC better, not to scan ports with it. Read a manual of C sockets and make it in C (or C++) if you want speed.