This is probably a bigger task than you're imagining...
there's multiple filesystem formats being used in isos: ISO9660/joliet, rock ridge, UFS, and probably more if you're into 'exotic' ISOs. And there's various extentions and rule-relaxations as well.
Your best bet is probably finding a tool to extract ISOs, extract both files, then use mkisofs (or that Microsoft tool that allows only storing data for identical files once), and re-build the ISO.
It's a bit hacky, but at least you can automate the process...