All of the state icons are stored in one file (states.bam), so to insert a new one requires patching it in manually or overwriting the file completely, making it incompatible with other things that want to add new states. I wrote some code to do manual patching for the map icons file and it wasn't pretty. There's also a limited number of states available and I believe one of the popular mods replaces the file, filling up almost all of the unused states.
In EE they introduced a new BAM file format which is easier to patch and able to support more cycles in the file (which would basically eliminate the state limit), but creating a BAMv2 version of states.bam doesn't work.
I've learned that recent EE versions have externalized states by adding a new column to statdesc.2da, allowing the use of icons that are contained in other BAM files (not just states.bam). Hopefully, this means that the limit on number of states is also essentially gone.
So, to add a new state, you can append a row to statdesc.2da containing your new state number (which should be calculated at install time based on existing rows in the file), the string for the state, and the name of the BAM containing the state's icon.