When you type Quit in the window, are you using the client that's running the game, or a different client (even if it's on the same computer). If you're using a different client, then what you want is already incorporated into the game, otherwise you might try adding this to the client that's running the game.
Code:
on *:text:quit:*:{
  say $active $1
}