There is not a built in function or method that will allow you to rearrange the items by id like this. It is possible to do this but it would require creating a custom function that will need to do a couple of things.
You will first need to loop through the contents of the cart and get the itemIDs, then you can store these in an array. You can then create a new items array based on the itemIDs array, and finally you would set the items array for the cart to be the values from your newly sorted items array.
This might be a little difficult depending on your knowledge of php and experience with this type of manipulation.