Mince, I don't think you DECIDE if something is funny. It either is or it isn't. While some ideas are obviously funnier than others, I like to think I keep up a reasonable standard. Sometimes, I'm going down a certain line and it simply doesn't work so I scrap the idea and start again. I also spend ridiculous amounts of time trying to get the "rhythm" of the dialogue right. Often a joke works better if a key word has, say, three sylllables rather than two and I'll trawl around my brain till I find what I think works best.
By the way, does anyone else have to check the dictionary every time they use the word "rhythm"?