This is working quite well for me now
It doesn't include automatically inserted tabs, matched brackets or quotes within the current edit region. Therefore, the edit-region may be split into several edits, and/or the region may end before it should. What I'm doing is pressing Ctrl-Alt-H (or using my shortcut menu) to toggle highlighting of the edits. Regardless of this highlighting step, I can select the whole area and use Ctrl-Alt-C to define it as a single edit-region. I can do this at any time and it has the advantage that I can explicitly define the start and end points of the edit region.
It would be possible to create code to handle these automatic insertions (and other factors) but it would be quite detailed and never 100% foolproof. I think it is best with this kind of feature that you/I have some control over how it works. That is, let the feature create the edit regions as you code, then review and correct them to what you decide
should be considered as edit regions.
Again, I encourage feedback
"I'm here to save your life. But if I'm going to do that, I'll need total uninanonynymity." Me Myself & Irene.