Whenever I realize I'm being a goofball, I write it down. When I release the joke onstage, I love watching the effect it has on the audience. No one wants to see someone talk who takes themselves too seriously.
I'm a fairly ascetic person. And I do most of my writing at night. You don't get distracted, your brain goes into what you are writing about, into the world you're writing about, rather than into the world you're in.