Thanks for looking at it.
v3: - Drop new function WCMD_isEmptyOrJustWhiteSpace, simply use existing WCMD_skip_leading_spaces - Check if line before unbalanced block gets executed - Drop unneeded carets to create blockclosing.cmd
P.S.: Is there a way to maintain visibility of the old patch versions? And is rebasing expected to be done e.g. in two steps, as the "Compare with previous version" contains the rebase too?