Sorry, no, that is not the entire algorithm.
Using the stall next to the door creates a sense of vulnerability similar to sitting with your back to the door in a public place. It creates a situation whereby you will be the first, in a compromised position, to get stabbed, take a bullet, be mugged, or be grabbed by any raving homosexual lunatic rapist who may come through the door. It also creates a severe eye contact dilemma, including creating the uncomfortable feeling that it may in fact be YOU who turns out to be the raving homosexual lunatic rapist scanning the incoming traffic for a victim.
The corner is nearly always acceptable, for reasons much the opposite of the urinal adjacent to the door.
There is also the "historicity" factor, which is not explored in the test at all but often creates the most difficult situation. This is when you enter a restroom and discover a situation that simply should not be - a truly unnatural offence to all reason and human decency. For example, three adjacent urinals being occupied with plenty of potential space available. In this case you must either assume that there is some historical reason, due to a person or persons unknown who have left by the time you have arrived to have created this situation, or perhaps ALL THREEE are in fact a gang of raving homosexual lunatic rapists.
Similarly, you must be strategic in your choices so that if a person leaves after you have selected a stall you do not end up in a difficult to explain situation. How many times have we all pissed in silent agony after carefully making the correct choice only to have a rapid and unfortunate reshuffling of the other inhabitants make one appear to be a raving homosexual lunatic rapist? The inner struggle of wishing to explain to each and every new arrival the specific circumstances of your unfortunate predicament, with basic urinal etiquette requiring silence. The furtive glances, the clump of handwashers all together at the sink farthest from you as you fail to wash away the stench of accusation....
Oh, and for those of you without kids, entering the restroom with a kid is a very handy "by" to any and all of the above. Of course you must quickly and unapologetically squeeze in between the two bikers on the left and the trio of truck drivers on the right - you must alertly be about your business, scanning the room, and rapidly taking position to protect your progeny from the hordes of pedophilic raving homosexual lunatic rapists about.
Etc., ad nauseam.