I've seen for several months now that the sorting functions for the bag plugins are either broken, problematic (disappearing items), or incredibly slow. I was thinking of a possible nice solution, at least until Turbine puts some effort back into Lua.
Why not just sort the display of the inventory when the bag opens rather than having an explicit sort that tries moving the objects from bag slot to bag slot. I see in the code for some of the bag plugins that they just display the inventory from 1 to self.backpackSize. Is this possible to look at what is in each slot first, sort it, then display the slots in order?