One option might be: if a PART is received, mIRC can check if it sent a corresponding /part. If it didn't, it can assume that it was not user-initiated and keep the window open. But that's assuming that a server will never send a PART message in other contexts. It would also require mIRC to count and match all sent /parts to incoming PART messages, which would require the server to send a PART, or identifiable, related error messages, for every /part that mIRC sends. This sounds somewhat unreliable, depending on how a particular ircd has implemented this.

The other option would be to add a "Keep channels open after /part" option, just to cater for ZNC, which seems somewhat excessive.

It's a shame that there isn't a way for mIRC to know that this is a ZNC message to detach a channel window. I notice in your log that your mIRC sends a "-> irc.server.com PRIVMSG *status :detach #dstdfgfdg"... is this something that you initiated?