The logic is setup exactly as it was before in the previous Beta.
The reason it takes longer than before, is because the API has to perform all actions using input actions rather than calling client functions. When an item is on the cursor, there's no way to just "place it into a (col, row) position".
In game, if you pickup an item to the cursor, you'll notice how the image icon is centered on the image itself. As you move the mouse around your inventory to place it, you'll notice the mechanics for where the item gets placed is dependent on the mouse position and the image size. As a result, the logic has to move the item around the inventory to find the correct location based on the highlighting the client does.
As for the side effect of sorting items and then stashing them, that's a specific case of the default stash logic simply stashing everything but inventory shards. Each task is independent of each other, so there's no way for the SortInventoryTask to know what will or won't be stashed, unless you rewrote all town logic to work one specific way.
I think I can move SortInventoryTask to execute after HandleInventoryItemsTask, so it should only sort items left in the inventory once you're ready to leave town. That shouldn't cause any side effects, but everything as it is working right now is as intended. It's just that it's slower so it's more noticeable than before.
If you look at the EnableStashingOnFreeSpacePercent setting (paired with FreeSpaceToTriggerStashingPercent), you'll see that stashing doesn't have to happen each town run. Because of this, you do need items sorted so you avoid cases where quest items or items not stashed don't take up your whole inventory and trigger more frequent town runs.