One would require a creation/usurp trigger for every duchy with an even number of counties. It would be relatively easy to implement, though. Not trivial, but not rocket science, and it wouldn't even require a single dirty hack. Once implemented, it would also be quite easy to update even if Paradox's next patch totally changes de jure duchies around and invents a ton of new ones somehow. In fact, the brunt of the work to implement it would be immediately reusable for other relatively killer applications to ease maintenance, QA, and reduce bugs in mods which did not use the vanilla map, especially those that are significantly overhauling their map all the time.