I think you will like this small command line tool, developed by Microsoft, called Portquery, it allows exactly what you want to do, which is check open ports on a remote computer, including UDP ports.
You can download it
here.
For some information on how to use it and examples you can check
here.
This should be sufficient for what you want to do. You can use /run to call this command line tool from within mIRC, and using COM you could even relay the results back to mIRC.