For the stop file, would the server have to poll for its existence? I guess it's not such a big deal if you make it sleep between checks, and headless server seems to already use a busy loop when it's idle (version 3.9.1; estimated about 4-5% of a CPU core), but it would be useful to eliminate this if you want to run multiple servers on one machine.
I think signal handlers could work too.
So, for example, there could be a signal handler for SIGTERM (or some other signal) that makes the server quit if no game is in progress, or if a game is in progress, exit after the game is over (i.e. set "exit" mode if it is not already set).
Then you can do "killall megaglest", and all idle servers will quit immediately, but other servers will wait until they are finished, then quit.