There's no reason why this functionality should be in sed when it can be implemented on its own and re-used. IIRC there's an an example script to for that in _The Unix Programming Environment_. Better to use sudo than have everything implement its own sudo-like functionality, etc.
See "UNIX Style, or cat -v Considered Harmful" by Rob Pike (http://harmful.cat-v.org/cat-v/) for a longer discussion of this.