Reorder blocks inside query results

I have a query which gets all blocks with the tag #priorityA.
Now I want to reorder the blocks inside the results of the query:
I want to move the important blocks to the top with the shortcut Alt + Shift + Up and the less important blocks down with Alt + Shift + Down.
Sadly, moving blocks vertically is currently not possible inside search results.

One way to implement this:

Given a page with:

- block one 
- block two #priorityA
- block three
- block four #priorityA

The query result would be:

- block two #priorityA
- block four #priorityA

When having the cursor in block four of the query results and pressing Alt + Shift + Up, the original page shall be altered to:

- block one 
- block four #priorityA
- block two #priorityA
- block three

So block four is cut and inserted again above block two.
Technically, the same code could be called like when the user does drag’n’drop.

Furthermore, it would be nice to reorder blocks from different pages as well:

Given the query results look like:

Tasks
- block two #priorityA

Reminders
- buy bread #priorityA

then somehow the query results from the page Tasks are shown before the ones from the page Reminders.
When I try to move the block buy bread up with Alt + Shift + Up, then the order of the pages shall swap, resulting in:

Reminders
- buy bread #priorityA

Tasks
- block two #priorityA

How to implement this? I don’t know a good way to persist the order of the pages.