Script to fix inconsistent edition states

As can be seen in the test data some editions have states in consistent with their version number as a result of not being correctly archived.
I'm surprised Rubocop didn't pick that up, will fix.