Michael,
I don’t think so. I think it should be the CASE statement. There is a bug in folding CASE statement in some situations since the Editor has been replaced to Scintilla. I think I drop a post about it in the 12.7 beta cycle, and this is a known issue.
If I delete the $IF and $END rows the folding still generates error.
Tamas