I have around 400 attributes. I created over time a good scheme for names from the very beginning. Now I have to add 190 more attributes. I have an issue, how can I sort attribute names before appearing in Unassigned Attributes column? As it is now adding 190 attributes more they will be placed at the end and it will be painful to create 20 attributes sets and scroll up and down for finding the right attributes. I already did this and I get tired. It should be easy to list these attributes based on attribute_code not the id order in database but I don't know where to find the code.
See the image bellow.
As far as I know, in Magento back-end you can sort unassigned attributes using drag&drop only, though you still need to move them to needed position.
If you are interested in alternative, you can try Store Manager for Magento application. Using it you can sort unassigned attributes by name and put them in alphabetical order with one click -
It is paid, but there is fully-functional 2-weeks free version you can download from the link in my signature and do the task without fees (in case this is one-time task) .