The way it was explained to me is that it is officially by date of testing. If the test dates are the same then it would be by age. If the age is the same then by Birthday.

In the case of twins of the same rank then the one out first would be higher ranked

I personally think it is a good practice to differentiate between ranks when sitting in seiza, but not so important within the same rank.

Usually I would suggest that you find a spot at the end of your rank when you come in the dojo or even at the end of the line if you are running late and arrive just before your instructor walks onto the mat.

Shodokan Honbu might have a slight variation on that after the point where test dates are the same. Whatever it is, Shihan decides.

I also don't think there should be any great effort expended in getting the order right for the Nidans and Shodans unless the Nidan has been there forever. My usual practice is to sit roughly right and let the Japanese sort it out - I can't read the board (where its all laid out) anyway.

UnfortunatelyI had to go to war over this issue over the last two weeks. To be fair a godan helped me out initially and even Shihan physically manipulated the situation to where it was supposed to be at one point. I graded on the same day as one Japanese dojo member. On hindsight he has been ensuring that he is sitting ahead of me for quite a while but it started to get very aggressive both in line up and when we were paired. I am sure there is more to this than I figured out but he was getting very rude. Turns out by rights he should have been below me and last class that is where he ended up. Up or down - there is no way he should have been behaving as he was.

The idea of the rules I think is to prevent this sort of posturing from happening - even though it does. I doubt he would have tried it with a Japanese.