The reason i wrote the code was so i could re-order items in the relational table using a dataAssist list, and the reordering code you provided.
The problem i was experiencing was when the relational records were created, there was no way of defining an initial order for them, i had tried to use the <?php echo $RepeatSelectionCounter_1; ?> but couldnt get it to integrate well.
i could just set the values as 0 but in this case when i went to the list page to reorder the records, all the records had the same order id of 0 so the drag and dropping did not change the order of the records.
this script basically sets the order from 1 upwards for the records being entered.
and reorders it on delete or update removing any gaps for the removed records any new records are placed a the top of the originally orderd list.
hope that clarifys it a bit