You can type "/localinfo -u" in the editbox of any mIRC window (e.g. the status window). After a few moments mIRC should print some kind of reply (at least some error message) to your status window. Just make sure you are connected while you issue the command because "-u" stands for "userhost" lookup, that is: try to get the IP via the IRC server.
In case you don't see any
reply to the command in your status window, what reply do you get to the following command?
//echo -a $md5($mircexe,2) $script(0) $dll(0) $com(0) $version $os $isalias(localinfo)
As for the workaround script: open the mIRC Scripts Editor (Alt-R), go to the tab "Remote", select "New" in the file menu, paste in the code, and "Save as:" "localinfo-IP.mrc".
Even if you succeed with the script, I'm curious why the regular lookup isn't working for you...