The swapping of places between spellbooks has always been an issue for me, as I prefer wizards and usually get lots of spellbooks.
As for the identified and un-ided spellbooks - I think those should be in separate pools, i.e first identified books in alphabetical order, then un-ided, similarly in alphabetical order.
I guess the order could be affected by the scroll of amnesia if carelessly read, but other than that this would improve equipment management.