I like the idea of an IDE distinguishing between scope types with colors, lines, or rectangles. Just this week I had to scroll up a few pages of C++ to check how deep a line is in scope. It would have been useful to see that the scope was: namespace, class, method, lambda block, for block, if block, if block.
That sounds like the code needs some refactoring. If only to clearly encapsulate individual steps.
Sure, you can do that if you want!
If this was done well, it could greatly increase both the readability and density of code, as viewed on screen.
I believe cognitive impedance mismatch major component of the hardness of programming as an activity.
Emacs has rainbow-delimiters and rainbow-blocks (and show-paren).