Done the first stable version:
https://www.mobileread.com/forums/sh....php?p=3697837
I've added more consistency checks (no more worries about the above issues, as it now rereads everything at the end to make sure it is what is expected), support for the old format, separate file for patch_enable overrides, many bugfixes, and quite a bit more. I've also tested the latest version on Windows (7, 8, 10) and Linux (Debian, Fedora). macOS hasn't been tested for the latest version (but it has for the previous ones), but it should work fine.