Hmm... interesting. So that would be...

Code:
var %format_string = You are $iif($qt([username]) == "", not logged in, logged in as [username]) $+ .
var %reply = $eval($replacex(%format_string, [username], %username), 2)


That would work in all cases except when [username] is set to ""
This is because...
$qt() -> ""
$qt("") -> ""

This would work 99.9999999% of the time. There is one easy fix for this. I could do something like...

Code:
var %format_string = You are $iif(_ $+ [username] == _, not logged in, logged in as [username]) $+ .
var %reply = $eval($replacex(%format_string, [username], %username), 2)


This will always work. The only problem is, I would have to document that it MUST be done this way to avoid errors (If I were the only person using this script, it would not be a problem, but this is going to be available to the public, and I don't want to require them to do this).

This is a very good temporary solution, but I still strongly believe that future versions of mIRC should know how to interpret the conditional expression ( == $null)