OTOH, this would currently only be recommended in the current file, or perhaps a set of open files (i.e., the end-user would want to be extremely vigilant about what they're doing).
What makes this possible is far simpler than one might imagine. Textmate, and therefore ST, uses scopes for highlighting. Yes, it's that easy. We would still need someone to script up something which can examine the scope already assigned to a particular piece of code (assuming one is using an existing highlighter; if not, one would need to be created--unfortunately, this isn't trivial--or "imported" from TM) and go from there, but it should be nearly trivial.
Info on all of this is available in the Textmate and (to a lesser extent) ST docs. I don't have time right now to scrape together all of the links.
I'm not certain about differences between ST2 & 3, but my sense is that this functionality has not changed significantly.
 More specifically, the "unofficial" ST docs.