My preferred rule is that hyphenated words count as one.
If I was making a program for wordcounts, the logic would look a bit like this:
Check for double and triple hyphens/equals/tildes, mdashes, double/triple periods, and ellipsis marks and replace them with a space.
Replace New Lines with spaces (ugh, *NIX vs. Windows problem).
Remove all superfluous spaces.
Do a Split on spaces and count the elements in the resulting array.
If I'm not forgetting anything, this would results in a wordcount that is more accurate than Write Or Die, Notepad++ and the Windows beta of Scrivener.
I'm probably forgetting a few rules. It's hard to hold all the various quibbles in one's head.
I'm not sure how feasible it is to do a real-time word count in Javascript. One as accurate (horribly inaccurate) as the one in Write Or Die is clearly feasible in real-time in Javascript, but a fancy one? We'll see.

If I was more motivated, I would have already made a Javascript word counter. I thought about making one for Android (native) both so I could have it and so I could get a few bucks.
