Any identifiers filled within any event should not be emptied until that event code ends. That is normal mIRC behaviour.
- Well apparently not because the same occurs with $target in various input/key* events with @windows, which is what Coolkill is presumably talking about. Maybe it should keep that information, but there's currently nothing that explicitly says that it will keep those identifiers filled.