The sort is there because the attributes have to be grouped by Attribute Group otherwise the assignment to their correct dropdown gets screwed up. So the sort is used to make sure that his happpens, otherwise if you added 4 original Colours, then some Sizes, then another Colour, the final Colour would get its own dropdown and form field names and ids would be screwy. Removing the sort will only work if your attributes (in the db/attributes.php file) are listed in Group order AND WILL NOT BE CHANGED via Admin. Then the attributes will be returned in the order they appear in the file. There is an array_multisort call in PHP that will sort arrays of arrays (which this is) but it requires some data manipulation to start with so you can't just plug it in in place of 'sort'.
Tthe first field in db/attributes.php in groupname and the second field is attribute name. I'm thinking of a way to remove sorting after the first field. So that only field one gets sorted... Maybe I have to learn php and I'l code it ;-)
Of course I mean sorting the hole row by looking only at first column :-)