Thanks for your bug report. This is not actually related to $v1 and $v2. As you discovered, when you use the ()/{} brackets, $v1 and $v2 are correct. The reason for this is that without the ()/{} brackets, the if statement does not know where the if comparison ends. So it has to keep evaluating the line until it finds the enclosing ()/{} brackets. In this case, $v1 and $v2 are evaluated during if processing, in an attempt to determine the second set of comparison parameters.

mIRC has to allow non-use of ()/{} brackets for backwards compatibility because that is how the if constuct was originally implemented, however as mentioned in the help file, ()/{} should be used as much as possible to prevent ambiguity.