When you use a "return" without writing any parameters, you are saying that you want to use it just like a brake, that is, its only purpose is to stop the execution of the code in that point (and exit from the function). This returns the value None in case you were wondering.
If you apply a boolean operator like IF or NOT to an INT, the rule is 0 == False and every other value is True
In other words, the Not count line will be True when count==0 and Not count will be False for every value of count other than 0
Example:
In [16]: not 1 Out[16]: False In [17]: not 0 Out[17]: True
So the statements.
if not count: pygame.quit() return
When count==0 the "pygame.quit()" and the "return" statement is executed which ends the execution of the main function and finalize pygame.