Picard adds IDs too (well, I think it only adds musicbrainz ids, per default anyway, but those are the only ones I care about).
The lookup is automatic as well (you can review or intervene if it fails to identify the release).
It also has a plugin for replay gain (I redo that step in my script anyways) and can be configured to delete any previous tags if you re-process music that you had previously tagged with some other software (IIRC it doesn’t clean them up per default).
If you’ve not used it, I recommend giving it a try before deciding how to go on.
Hand-coded or LLM-coded?