As a workaround, you could bind cmd+q to call your function instead, and then your function could save everything and tell sublime to quit.Also, if you set a view as scratch, then it won't ask you to save it when you close it. You could set all your untitled views to scratch mode and they would just be deleted when you close the program.

I would be interested on running the project's Build command (edit: on exit), but only on a per-project setting. (Some of my text, but not code, projects, have a build command, which basically just commits all changes to the repo. Just so I can go back in time, in case I delete something useful my mistake.) Any thoughts on how I would implement this?

The @adzenith's method won't work, because it has to be per-project. (Also, I've disabled Ctrl+Q. I use my WM/OS functionality to close sublime.)

You could just use the same command, and have it check if a project is open before doing anything.There's also on_pre_close, which gets fired per file... you could maybe have a counter and if enough files are closing then run your command? You could collect the filenames and run the command on the files on disk, because you aren't actually able to stop the views from closing.