Testing with mIRC 7.69, ZNC 1.8.2, and the most recent version of the code I posted I'm not seeing any issues. Messages sent while there are multiple clients attached as well as during buffer playback appear to be handled properly. I can't think of a reason why a nick would not be present for a message. If you can come up with a way to reproduce the issue let me know.

I'll make an effort to keep the script valid and working for the znc.in/self-message capability for stable releases if someone informs me there's an issue. I won't be testing with the beta version. I know Khaled has been making changes to how mIRC implements the IRCv3 echo-message capability in the beta and maybe there's a potential that my code won't work properly with the next stable release. If that happens update this thread with the details and I'll take a look.