I know squad script isnt on the vanilla game,but hell,I dont know where else to suggest it =P
Basically,the idea is: If you are in the same squad as player A,B and C,if you are spectating ,lets say, player A, while you are dead and he alive,you will spawn on Player A,and same applies with Player B and Player C.If you are spectating anyone else,it will be choosen randomly.