This happens to me from time to time (mirc.ini getting lost/corrupted, but not related to sleep mode), usually because I get mIRC to crash in some ways
If mIRC crashes, there is no way to guarantee that a file will be saved properly. For example, if the crash is due to a bug that overwrites mIRC's settings in memory, and mIRC then attempts to save the settings to mirc.ini, it may end up saving invalid data. The only solution in this case is to try to find out the cause of the crash so that it can be fixed. That said, when Windows is in a low resource state, and Windows and/or applications are unable to allocate memory or save files to disk, and end up freezing/crashing because of the low resource state, almost anything can happen, including crashing and file corruption.
Well if mIRC makes sure the temporary file is created without any problem, how come it's even possible to see that kind of stuff happening?
Good question. The only reason I can think of is write caching. Most primary drives have write caching enabled to speed up disk access. Microsoft states that "By enabling write caching, file system corruption and/or data loss could occur if the machine experiences a power, device or system failure and cannot be shutdown properly". However, I cannot say for sure whether this also applies in low resource situations where Windows itself has run out of disk space and/or memory.