Fix do end auto-correct

For #948. Check syntax tree so we don't destroy the code with an auto-correction in `Blocks`.

The message still says `[Corrected]`, but that's a separate problem described in #800.