It is not possible to accurately detect afk players. Best would be "since when did the last kill happen for that guy" which would only be an estimation.
Would that be accurate enough according to you ?
Do you see any tricky situation (like round change / team survivor game types, etc) ?
I guess I should have been clearer.. I was thinking this but didn't type it.
What I meant was a SPECTATOR kick by player count. If someone stays as a spectator after X number of seconds/minutes after X number of players are on the server, they get kicked.
However, your idea would also been good. Perhaps give the admin the choice to configure it to warn the player (announce to admins) or kick the player.