Script Summary: Toggles comments (useful for word counts)
Google Docs has no way of excluding comments (from the Insert > Comments menu, or Ctrl-M) from a document's word count. This script will let you toggle comments. When they are hidden, they won't contribute to your word count.
Your comments are not deleted! They are merely hidden.