I was actually working on a mod on this topic back in the days. Or, should I say, rather playing around since I never got anything real done. More like trying out the whole modding thing.
My vision of energy mod was pretty much the same you described. I am confident that it is doable and it would not even be hard. Even I could add the resource and make some buildings produce and some consume it. The AI part also would probably not be difficult, but finding exact values for flavors would need some effort, I think.
I dropped this project because I just couldn't find the time for it. However, today I thought I could have a look on this idea and found this thread. Is this a sign or something? What do you people think, should this be done?
EDIT: First post, btw! After a year of passive lurking.