If you include fetchMetadata: widgetOrder in the repeater’s config they will be ordered based on this metadata (“Default Widget Order Index”). I’ve been made aware that there’s a bug in that comparator function so indexes are compared as strings, so it goes like this:
-1 < 0 < 1 < 10 < 11 < 12 < … < 2 < 20 < …
You won’t run a problem until you use indexes < 10 and => 10 at the time.
AFAIR there’s nothing available to sort by state.