Rearrange color palette methods

Is there a best practice/efficient method to rearrange your color palette for a COLR font? I’m upgrading some past creations, and although I originally used a logical color arrangement, the added colours for the upgrade make it a bit of a mess and hard to keep track of. I now am planning to rebuild the palette and then rearrange it in the code, but is this the best method?

Probably a script should do this.

Cheers. The recoding was simple, just wanted to know for sure.