If you test this with a clean install, placing both mirc.exe and an empty mirc.ini in an empty folder, do you still see the same issue?

I can't seem to reproduce this issue here. I have just tested this with both a valid and a random IP address, and mIRC retains whatever I enter, both when I connect/disconnect from servers, and when close/restart mIRC.

Are you running two different versions of mIRC from the same mirc.ini file?