Actually, closing curly-braces can be seen inside a REM or ; comment, and pipe symbols can also be seen inside a comment for purposes of treating the remainder as a comment. /semicolontestA 1 and /semicolontestA 0 behave as you expect, but /semicolontestB never shows the $false message because the comment is not separated from that closing brace by a pipe. REM works the same way as semi-colon here, and the closing bracket is seen for other code, it's just that using the if() demonstrates that conditional branching can't play nice with this edge case. I'm guessing while { } would also have the same branching glitch.

The /* */ comment format won't have any of those issues. It does indent using braces, but won't trigger the mismatch warning if the braces don't match. You can also use braces inside this block to format your text comment for easier reading, but it won't work as expected if you put anything else on the same line with your braces.

Code
/*
{
  text
  text
  {
    emphasized text
    emphasized text
  }
  text
  text
}

*/

Code
alias semicolontestA {
  if ($1 == 1) { echo -a $true msg | rem noop | noop }
  else echo -a $false msg
}
alias semicolontestB {
  if ($1 == 1) { echo -a $true msg | noop | rem noop }
  else echo -a $false msg
}


More detail in https://forums.mirc.com/ubbthreads.php/ubb/showflat/Number/232920/