Well, first there are already coin operated filtered water dispensers... Hope this wasn't a commercial business idea.
Having had some recent experience in the coin operated field, I can say the sorting/rejection is mostly mechanical. The coins roll down a pathway and sorted by size. Couple of weeks ago, three japanese slot machines were dumped off on me. I just finished converting one to accept quarters. Haven't check to see if I defeated it's ability to reject other coins, but it wasn't a concern. It origional took 30mm tokens (half dollar size). I found out buying tokens would cost about 20 cents each with shipping...
An opto-interupter detects a valid coin. I'm not sure if it would be worth time and money trying to build something like in these machines at home, unless you have some serious shop tools. Coin accepters didn't seem too expensive when I was searching for documentation and tokens for the slots.
Personally, I think bottled/filter water is a huge scam. If the tap water is really that bad, people should get it fixed. If you have a well, get your own filter system, at $1.00 for a 20 ounce bottle mostly likely pay for itself first year...