I guess mIRC tries to continue parsing at a specific "byte position" and can't recover this position if the code was changed in the meantime.
You can produce this bug (I think it's the same issue) with an input prompt as well:
Code:
alias bug {
  if ($input(Input prompts open a modal window and the execution of the alias currently running is paused. $&
    $str($crlf,2) $+ If you change (and save) some part of this very text while the input prompt is open $&
    (open the scripts editor in "normal" mode so you can switch between the editor and some editbox) $&
    you should be able to reproduce the bug.,og,How to reproduce the bug)) { 
    ECHO -ag Or change some part of this echo command. A single char should be sufficient.
  }
}

Results in e.g.:
* /Àgecho: not connected to server
* /0'echo: not connected to server
* /ð~/hå5: not connected to server
* /if: close bracket not found