BTW, a digic processor does not run an interpreter, it requires code that has been compiled into machine language. Your "20 lines of code" becomes quite large at the machine level, plus you are going to need a huge amount of memory to hold the 70+ Megawords of array to hold that image, and since it requires real-time operation you can not interfere with resources and CPU cycles required for other processes.Then write the code. You should be able to knock out those 20 lines in a few minutes. Let us know how it works when you are done. Harry could probably help you. Honestly, a tool like that would be more helpful in the film era. Personally, perfect shadow detail ain't real high on my wish list. Knock yourself out. I didn't realize we had so many coders with so much knowledge around here.
It also takes a lot more computing power to analyze a 70+ megapixel RAW file for histograms and zebras than it does to analyze a 1 megapixel JPG file, so not only does he have to write the code and determine if it reacts badly to other code, but he will have to somehow find more CPU cycles.... a lot more!
There is always a reason why things are done the way that they are.