> trying to retrofit to bring it in compliance with electrical code
If everyone did that, we'd never be finished. If it was inspected when installed, it's good now. If you start modifying connections and wires, more than changing batteries, you might need a permit and inspection for that, but generally not.
If you are wanting to improve things, and move, upgrade wires, install DC arc fault, AC arc fault, that's going to be new permits and new inspections and the whole bureaucratic nightmare and replacements up the wazoo.
If it aint broke, don't fix it.