If it's a loop causing mIRC to lock up, try WhileFix.dll (you can get it on most major scripting sites)

I think it also has a $findfile() function that doesn't lock up mIRC.