1. Your team restoring method doesn't take care of manual team changes.
2. I recommend to hook ClCorpse message/event. set_task would be needed if there wasn't such accurate way.
3. I recommend to hook the new round instead of a round end (see the "Code Snippets/Tutorials" section for details). Then you obviously will not need #Game_will_restart_in hook.
4. If yo skip bots in the second case, you obviously have to check for them in the first case as well. Bot potentially may recieve the corresponding access level.