Works fine here:
//var %a = A, %b = B | if (%a) echo -a $iif(%b,2,3) bla $ifmatch
echoes "2 bla B", which is correct: $ifmatch is filled by the first part of the condition in $iif(), which is %b.
If %b is $null, 0 or $false, $ifmatch is correctly set to $null, since the last condition was FALSE:
//var %a = A, %b = 0 | if (%a) echo -a $iif(%b,2,3) bla $ifmatch