I don't know whether this is relevant to your plans but someone in the epub forum has written an epub utility, called epubFixer, which already has some rather nice facilities for manipulating toc.ncx.
Here's a link if you want to know more.
It's obviously not a Calibre plugin, but it can easily be run using your 'Open With' plugin