I could see a couple ways to do it. If your doing a query to create the dataset I’d just do and “Order By” in the query. In there you can do both at once and gets rid of the extra step.
If for some reason you can’t do it in the query you can use either the expression sortDataset twice or you can use the script function system.dataset.sort(). Again you would have to run it twice. I’m pretty sure you will need to order it by your sequence number first then by your Up’s and down’s to get it to show how you want it to.
If for some reason you decide you want to do what you mentioned last, you can use system.dataset.appendDataset() to combine the datasets. It should leave them how you put them together, it would just combine the two by putting the second dataset at the bottom.