Certainly, when you're starting out, the idea of writing a 40 page, half-hour script is daunting. A decent sitcom script needs at least three good laugh-out-loud jokes per page. I'd say you need four, really. That's 160 laugh-out-loud jokes per script. (This, incidentally is why comedy writers have no respect for people who work in advertising, who work for six months and spend £500k shooting a thirty-second commercial that is essentially one joke). Times that 160 by six if you're writing a series. That's nearly 1000 jokes.
Character is King, but Story is God
The temptation, then, is to think of funny things people can say and funny situations - and cling on to them. Pile them up! Ideally, you need to work out a way to get from one funny bit to the next in a way that's plausible. Some writers (eg the venerable Graham Linehan) do take this approach, but even they would not recommend this as a way to go about things. It's a good starting point, but a sitcom script is not built brick by brick as if the jokes are little pieces of lego - and you stop building once your tower is high enough. A sitcom script is designed, planned and then written. And then redesigned and rewritten.
Although the actual story itself is normally the least amusing part of a sitcom (compared to the characters and their reactions to the story/situation/other character), it can easily be neglected. But it is incredibly important. It's the spine that hold the body up. It's the solid chassis on which the car is built. It's the foundations on which the house is built.
What's more, the audience are subconsciously expecting everything in a show to be significant. A funny set-piece scene is great, but if it doesn't lead anywhere or advance the story, the audience will be genuinely confused, or expecting a development that never happens. And, as I say regularly on this blog, confusion is the enemy of comedy.
Over on Chortle, there's a really good interview with Mitchell and Webb, who pay tribute to Sam Bain and Jesse Armstrong, the writers of Peep Show in saying this:
Mitchell: The key thing with Sam and Jesse’s approach is to get story right.
Webb: They spend a lot of time on the structure of the story, then it’s almost as if they treat themselves to dialogue at the end, which is the opposite way around to whenever we’ve done stuff, when we’ve done it one joke at a time.
Mitchell: They’ll throw anything out, however funny it seems, if it doesn’t fit what they see as the right arc for that story, episode or series, they will throw it out without a qualm.
Webb: They are amazing rewriters. That’s the trick, to be really unprecious about really funny stuff.
Mitchell: It’s also the difference with us being writer-performers. We got into this to go on stage and make people laugh then and there. If you’ve got something in your hand that you’re 99 per cent sure will go over well and get a laugh, you’re very reluctant to throw it out. Sam and Jessie have never been on stage getting laughs, so they can be a lot more ruthless with what they throw it. It’s such hard work getting the structure of a sitcom right. You have to think how are we going to get him from A to C and they just sit there and think hard...David Mitchell's point is a good one at the end, there. It's not that good writers are natural geniuses for coming up with suitable jokes and scenes that form a story. Clearly talent and experience are very useful and can save time on occasions. The reality is that good writers realise they need to sit there and think hard and churn through dozens of ideas until they come up with the right jokes for the right story that get from A to C (and back to A again) in the right way - even if it means junking really funny stuff.
Don't Mention Fawlty Towers
John Cleese and Connie Booth famously spent half of the writing time for Fawlty Towers plotting, planning and getting the story right. I'm puzzled that this is seen to be exceptional. Getting the story right, getting the character arcs consistently moving forward so that the jokes will fire on all cylinders is a huge amount of work. I wonder if some writers shy away from it because they assume that if it takes that long they must be doing it wrong. Nope. It just takes ages. That's why it's a full-time job and very difficult to fit in around other things.
The moral of the story is the same as it usually is. You probably need to rewrite your script. Sorry. But as you do, ask yourself what each scene is achieving and what each line is achieving - and how it relates to the central story or your sub plot. When rewriting, a line my colleague and I often say to each other is 'I'm not sure this line is working hard enough for us' - which means the line is woolly and doesn't move things along. If you're script is really good, there's no room for lines like that.
So. Print your script out, and go through it with a red pen and cross out stuff that isn't part of the story. (If it's really painful, paste it into another document and base a new story around that bit you really like and can't live without.) Then go back to your script and trust yourself to fill in the gaps or make up the time with new lines and scenes that are relevant, characterful - and therefore much funnier. But be warned. It'll take ages. If you're doing it right. And you'll discover that 40 pages and half and hour really isn't quite long enough.