If the view is not set to keep sorted, you can drag and drop records to change their order. Scripting can query the view to get the records in the view’s order, although if the view has grouping you might have to manually deal with grouping. The script can then update a numeric field so that the numeric order matches the manual order.
As I said in my previous post, scripting can query the view to get the records in the view’s order, then the script must manually do the grouping. If you are interested in more detailed instructions from me and have budget, feel free to book an appointment with me.
Automations cannot be triggered by a manual resort of records, or any other change in the user interface. Automation can only be triggered by a data change to a record or by schedule.