FYI, I encountered something that's related either to this thread or to https://forums.mirc.com/ubbthreads.php/topics/261001/v1-v2-inconsistancy

The $v1 being null relates to the other thread, however it would have been easier to catch if the parenthesis count reaching negative generates an error.

I generally do use parenthesis just because it makes the code easier to read, plus I don't need to remember where they're optional and where they're not. So, I'm more interested in the negative parenthesis count than the other issue. In this example the $v1 is set correctly in the /else condition but is $null in the $true condition

Code
//var %a $rand(0,9) | if $right(%a,1) isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a
//var %a $rand(0,9) | if           %a isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a
//var %a $rand(0,9) | if            3 isin 13579) echo -a $v1 is odd %a | else echo -a $v1 is even %a



Correction: I see now that the $v1 in the $true condition isn't actually $null, it's carried forward from the prior conditional, whether it's a prior if() or while(). Here, when %a is an odd number then $v1 remains as abcd from the prior if()

//var %a $rand(0,9) | if (abcd == defg) noop | if %a isin 13579 echo -a $v1 is odd %a | else echo -a $v1 is even %a