Found another case where the parsing fails. Even though this is not a nested while() and fails in method2 where the while() open/close braces are on 2 lines, it may be related to the changes that affected the above testcontinue-2, as all 5 methods work up through v7.38, but beginning v7.41 thru the current beta, method 1 and 2 fail while the other 3 keep working.
Code
alias test1234 {
  var %i 0 , %a, %pattern ^(?!.*(.).*\1)[1234]{4}$ | while (%i isnum 0-4321) { if ($regex(%i,^(?!.*(.).*\1)[1234]{4}$) > 0)   var %a %a %i   | inc %i }
  echo -at method1 %a

  var %i 0 , %a, %pattern ^(?!.*(.).*\1)[1234]{4}$ | while (%i isnum 0-4321) {
  if ($regex(%i,^(?!.*(.).*\1)[1234]{4}$) > 0)   var %a %a %i   | inc %i }
  echo -at method2 %a

  var %i 0 , %a, %pattern ^(?!.*(.).*\1)[1234]{4}$ | while (%i isnum 0-4321) { if ($regex(%i,^(?!.*(.).*\1)[1234]{4}$) > 0)   var %a %a %i   | inc %i
  }
  echo -at method3 %a

  var %i 0 , %a, %pattern ^(?!.*(.).*\1)[1234]{4}$ | while (%i isnum 0-4321) { if ($regex(%i,%pattern                ) > 0)   var %a %a %i   | inc %i }
  echo -at method4 %a

  var %i 0 , %a, %pattern ^(?!.*(.).*\1)[1234]{4}$ | while (%i isnum 0-4321) { if ($regex(%i,^(?!.*(.).*\1)[1234]{4}$) > 0) { var %a %a %i } | inc %i }
  echo -at method5 %a
}