Why would it quit game if you type quit_game()?
To quit the game via Lua script, you need to use the
os functions.
... why don't you just add the
quit action part found under miscellaneous in the action part list? There's no need to script quit or anything else; unless you prefer scripting / programming over visual design / development.