It seems like $result doesn't work from within an $iif-condition. This piece of example code shows the problem:
alias bar return test
alias foo {
bar
echo -ag $iif($result == test,$result == test,$result != test)
if ($result == test) echo -ag $result == test
}
The result of calling /foo:
test != test
test == test
This is on mIRC 6.15, I haven't tested it on older versions.