Seems like heirloom and lore shouldn't be grouped together, but lore and no trade should; an item can be lore or heirloom or both lore and heirloom, but if it's heirloom, it's also always no trade.
I eventually noticed that the default sort was more or less by Weight Reduction. Through a couple of external tools, I have now sorted it by W.R., then # of slots, then name.
I will make a few more adjustments, such as grouping the Loyalty bags by month order.