In most cases tv shows are written week by week so in most cases you nor does the actors know what will happen next week until its completely shot.
In the case of Arrested development it is a mix of pre-planning and happy accidents.
Example: S01 Buster says "wow never thought i would miss a hand so much. In S02 Buster gets his hand bit off while swimming in the ocean" (Happy accident)
Example: through out the show they mention the Homefills in fact they are mentioned in S01E01. through out the show you get running homefill gags like at the end when they find the fake bomb which is a recording device which is a homefill. (Pre-planned running gag)
The truth about writing is that it is different for every case. Take David Milch... he wrote the first ten episodes had all the characters, setting, plots, motives for a show to be set in Rome. He pitched his idea to HBO who said "I can't believe, this is the best, only thing is we just bought a show like this." Today you know it as ROME by HBO . David walked away and a month later came back with the same characters, plots, and motives, all he did was change the setting and everything else to reflect the settings change. Today you know the show as Deadwood.
Pay attention to the writing in T.V, a great example is Rescue Me and Sirens. Both shows are written by the the same two people and if you throw away the actors they are the same show, from the pace of the dialogue, to what is talked about, the mood and atmosphere, what they stand for, if you take away the fact that they are firefighters from N.Y. (Rescue Me) and paramedics from Chicago (Sirens), there is very little difference.
To continue some shows have multiple writers for one show. Meaning this weeks episode is written by Sally and she understands that Michael B. is a selfless person so he will do selfless acts for his family. Well next weeks episode is written by Joe and he doesn't know a thing so Michael will do whatever is necessary for himself. - that is bad writing leading us to believe 2 things, the show should be written by the same people and that they should be written at the same time.
Now you need to take into fact that the actors maybe filming a movie soon or run into unexpected problems as they can't be on set.(remember even though they are stuck up, selfcenterd, rich actors, they work long hours everyday just like you and me) Now if I wrote 10 episodes and my actor is in all ten and he will start shooting a film over seas next week, I now have to either A. rewrite the episode, B. write a hole new episode excluding that character.
T.V writing is a very fast and unpredictable job (forget the fact it's nearly impossible to get a writing job)
Matt Stone and Trey Parker (South Park) - say when writing always remember if a character does something then something else has to happen, in order to push the story forward.
Check out - "South Parks 6 Days To Air"
They go inside South Parks Studios and watch Matt and Trey as they come up with an episode on the fly... You get one again ONE way of writing T.V.