Store the Lobby SteamID while the game server is active and add functions to Python to get this lobby id and set the server state.
Add WriteFile option to filesystem Python module. Also make the filesystem module kind of safer by only allowing write/read in game folder (although Python's other file objects will need to be removed or preferably sandboxed).
Fix mistake in checking game server state and switch to switch construction.