The TV Writer’s Workbook: A Creative Approach To Television Scripts is the book that helped me the most while i wrote the office spec that got me to the final round of the nickelodeon writing fellowship last year. if you want to know how to write a good spec script, you must get this and actually do the exercises. one thing she recommends is breaking down scripts of the show you want to spec to dissect the structure. it’s very tedious and time consuming, but so worth it, because it will give you an understanding of the structure of the show that a casual read will not.
she is also working on a book that covers writing a pilot. as far as i know, there are currently no books on that subject. i just took her one day seminar on writing a pilot, and she passed out what she has so far to the class to take home. get that too when it comes out.