you can use MR,
From input stage,
pass Sales order internal ID to map stage as key.
Iterate through the lines in map stage and build the logic to update the quantity.
even if you have to update quantity in 10k rows, with simple calculation, not having some searches to get the desired quantity and no other userevent script is slowing the process of saving the SO.
if you require some searches to be used on item record or something to be used, try to create a dictionary in either input stage or map stage and use that.
Per sales order it should not take more then 1-2 minutes at max.