Hi Niels,
I am going to provide a machine hacking solution which works better (humans <3 usability) if you are starting from scratch. It doesn't answer your javascript question (I suck at it too) and is perfectly fine if you dismiss it completely.
People are not very good at proving they are not machines (hence why you need reload). If you create a fake CAPTCHA system and hide it from view from humans (with a CSS class that has display:none) then ALL the machines will fill it out and you can catch that and return a success page, block the offender's IP and dismiss the comment or signup information. It is not necessarily easier to implement than a service like Re-CAPTCHA but it's ALL code based and CANDY for humans who hate CAPTCHA.
Good luck!
Marie-Lynn