Thanks for your bug report.

The $network identifier may return a value whether connected or not. It depends on whether mIRC has found a network name from your servers list, and so on.

However, the $server identifier should only return a value when connected. There are some situations where it will return a value after disconnecting, for example during the on DISCONNECT or CONNECTFAIL events. But I have not been able to reproduce an issue with $server returning a value while disconnected yet.