I'd only add that this isn't particular to $iif(), any alias called after mirc jumps to :error causes /reseterror:
/alias test noop
//return $or( | :error | echo -a 1: $error | test | echo -a 2: $error
The reason $iif() does this too is that it's one of those "internal" aliases: each time you call it,
/!if (%s) { /!return 1 } | /!else { /!return 0 }
is executed behind the scenes.