Fascinating. Thank you for sharing this. I am trying to replicate it myself but there are some really strange things when I sort in the actual game.
Firstly, I noticed "Field" and "Battle" don't also organize by Type, and I always assumed they did. They actually just grab all the items that match criteria and pull them to the front, in the same order they were in before the sort. You can observe this when you first sort by Type, then Field, then Name, then Field again. You'll see the results of Field were different both times. Cos they just grab the items that qualify, but leave those qualifying items in the order they were already in.
Wondering if their sorting is actually broken though, because if you sort by Name, "All Creation" ends up in the 'A' section, but if you sort by Field, I expect knowing that it just grabs all qualifying items in current order and pulls them to the front, that the result would be alphabetized, and it is, except "All Creation" ends up in the 'P' section instead of 'A'. FF7 truly is full of mysteries.