I've just finished the first draft of a pilot. The main character is already well established (this is an animated project and I'm the voice and animator/director, so it's a little different from writing a script on spec, I suppose), and I let storyline work itself out in my head for about six weeks before sitting down to write.
The first draft is five minutes too short and doesn't have enough laughs in it, but it's shown me that a character I thought was a one-off is probably going to stick around for the whole series, and that I need to spend a lot more time developing the supporting characters.
I write a lot of material in the voice of the main character (an almost daily blog, for instance), and this is very useful for trying out gags and finding out little details about him which I may later be able to use in episodes of the sitcom. Something else I mean to try is to sign him up to some online discussion forums and reply to posts in character. Fleshing out a character using the real (virtual) world can be fun.