I think this is a good question whose benefits seem obvious but we should also consider the drawbacks related to adding this feature.
Drawbacks
Automation of pinyin can be problematic as this would introduce another component into the CSE. More components increase the number of breakage points. What happens when some folks enter pinyin? (does it break the javascript) or when the pinyin is wrong? (For example there are many occasions when a tonal change occurs based on a characters context. The pinyin engine would have to handle these issues). Javascript that is loaded from a different domain may also be blocked by countries. Javascript can be blocked by institutions and browsers as security risks.
Other Options
Existing tools can handle this based on browser and even operating systems. I've setup my Mac OS X for example, to speak highlighted text in Mandarin, English, or Cantonese (using keyboard shortcuts). Other tools that I have setup for the Mac include convert selected text to pinyin and lookup words in Chinese-English dictionary.
The benefits of using external (integrated) tools is that site clutter is reduced on CSE. Fewer javascript means less code, fewer errors, and less work having to be done by the browser. I haven't figured out all of the equivalent tools on Windows yet but I would not be surprised if there are already available assets.
In fact, one interesting tool that I find useful is to collect phrases and store them in the Google Translate Phrasebook. Using that tool one can also capture the valid pinyin and save resulting phrases across many devices. Phrasebooks can also be saved as cvs files so offline uses are possible.
Conclusion
Sometimes the benefits of a process outweigh the drawbacks and in those cases one should take action. The question becomes is this benefit significant enough to outweigh the drawbacks of the effort to design, implement, and maintain a viable solution. If not then action should be constrained. From my perspective, given my existing toolset and other options, I cannot see a demand to proceed at this time. I am however open to change if a sufficient argument can be made to proceed with this option or even with a different existing tool.