Okay here is my first pass
ePub_TOC_enhancer.pl eBookName.epub
It also has a recursive mode just put the '-R' switch after the executable to update all ePubs in the current directory and all it's sub directories.
Code:
usage: ePub_TOC_enhancer.pl eBookName.epub
-h : this (help) message
-R : Recursively search for ePUBs
Example: ePub_TOC_enhancer.pl -R
Will recursively search for ePUBs in
the current directory and all its children.
Example: ePub_TOC_enhancer.pl MYeBook.epub YOUReBook.epub OUReBOOK.epub
Will only fix the eBooks specified.