Technically, there is nothing wrong with that code. Did you put it in the Remotes tab of your mIRC script editor? Note that you cannot trigger the script (by typing !msg nick message) from the same mIRC that the script is running on.

-genius_at_work