This is really cool CodeMirror script!
I personally think we should retire "Design mode" for no popularity. Back in 2009 when we started it sounded very promising, but as practice showed it's easier and faster to change TPLs in IDEs for better success.
Anyway, I think we should plug CodeMirror in for our SQL Query textarea under tools to see how it's going to live there.
I am curious to know if we can teach it to parse / highlight In-Portal tags?
DA