The first thing you when you finish your script is register it with the US Copyright office.
http://www.copyright.gov/
It's not that hard and doesn't cost much.
After that, have the contract reviewed by an attorney experienced in representing writers.
Make sure the contract addresses the need for your approval of any changes and monetary penalties if the web developer fails to do so.
Your attorney should also be able to put anything else in your contract necessary to protect your interests.