When writing for a production, you need to understand about copyright. A writer can produce a really good script, and the production could copy it and claim it as theirs. In most countries, you automatically own the copyright when creating something, but the problem is when taking someone to court, you need to prove that you wrote it. This can be done using various methods, one of them could be sending yourself a copy of the work you are writing by recorded delivery. When the mail service deliver your work, don't open it, otherwise you pretty much void the evidence.
Even when quoting other people work, copyright is still in place. When quoting text, you can include up to 400 words in a single quote or 300 words at a time, you are not allowed to use more than a total of 800 words.