Yeah, should work.
Rezipping an EPUB is tricky, of course, because you have to deal with the mimetype file -- "can't be compressed, multiple passes to zip" garbage.

That's why I like calibre-debug --explode-book or alternatively the Editor, but they are geared toward human oversight not scripting.
I'm not really sure how you'd find the exploded ebook directory via a script in order to modify it. Usually it pops up the File Browser.

Or opens vim of course.
That's why I suggested a vimscript, you could probably load it automatically via a filetype plugin, apply the changes, save and exit without touching a single key...
... or maybe I enjoy making things harder, because it's more fun.