By the way, the script you're using won't count words in tables or footnotes.
In CS3 and later you can use this:
app.findGrepPreferences = null;
app.findGrepPreferences.findWhat = "[\\u\\l][-\\u\\l]+";
found = app.documents.findGrep ();
alert ("You have " + found.length + " words in this document.")
A "word" is defined here as any string of upper- and lower-case letters and hyphens. Maybe that's too strict, but you can tweak the GREP to suit your needs.
Sometimes my mind gets into a state where it overlooks the fact that you can use GREP to just find things -- I think of it as a feature that changes text. D'oh. Peter's approach is far superior to what I blathered on about.