I know what your on about Dorkey. I tried writing a similar script yesterday and placed it under OnJoinGame but It didn't work untill I moved it to OnJoinTeam.
My reccomendation is (although im new to all this stuff) place a script under OnJoinTeam which calculates which team needs them and then switches them to that team.
Command('/SETTEAM5 ' + inttostr(ID));
//Spectators Need this player
Will mean they choose a team and end up on another one but its the best I can think of.