The file below's now using the filter method like it did before, but is storing the "temp data" in a temporary, hidden mIRC window instead of a temporary .ini file - hopefully this will bypass your issue with !ip <ip>.

The !cleanips command uses the filter command too (again in connection with a hidden mIRC window). But as it seems to me that - on your system - the script is able to write data to the ips.ini, just unable to /filter that .ini to a ipsTEMP.ini, I suppose it will work none the less. (As !cleanips is filtering the cleaned data back to that already-existing ips.ini)

playerips(new).mrc

I removed the "ECHO 7 $chan" lines (orange color debug output) as well.