I assume that you address InDesign CC 2014. You mentioned this version in a different thread.
Unfortunately there is no move() method for the Swatch class.
So your only bet is to remove all custom swatches and add the swatches in the order you like.
But this will get you into trouble, if it is done with used swatches in your document. Search the Scripting forum for discussions and solutions around that.
Another option will be an export to IDML and edit the IDML by scripting to change the order.
For InDesign CC 2015.4—released today—there is a new sort feature for swatches you could explore.
( I did not test the new DOM yet, if we have direct access to do a custom sort on selected swatches or if we are able to select swatches in the Swatches Panel at all by scripting. Guess, no. )
Thank you Uwe
thank you so much.