So, what's the problem? Just snapshot the settings of a freshly factory-reset router, and then diff your changes against that.
Well, say hi to /etc/uci-defaults
It's a directory any package can put scripts in
And each of those scripts will run on every boot (and possibly also on other occasions) and try to set some uci settings. Until it succeeds, then that script won't run again.
If you're lucky, it will only set the defaults in the file in /etc/config that belongs to the package it's from