Well, here's a shortened (and simplified) version of a respawn thread I found over at ForgeHub.
Basically there are four factors when dealing with respawns:
-Teammates: Higher chance of spawning near one then: Enemies, Dead Teammate, or somewhere Random.
-Enemies: Less likely to spawn than near one then: Teammates, Dead Teammate, or a Random Location.
-Dead Teammate: Less likely to spawn than near one than: Random Location, Teammates. More likely to spawn near one than: Enemies.
-Random Location: Less likely to spawn near one than: Teammates. More likely to spawn near one than: Enemies, Dead Teammate, Random Location.
All of these are factored in when your about to spawn. The only real problem with this scenario, is that it doesn't take into account that an enemy could have his crosshairs right on your spawn.
[Edited on 07.03.2009 5:24 PM PDT]