You get copyright protection automatically. You can trademark key terms used by your new web site. Getting a patent is a lot more difficult, and patents are also quite difficult to defend.
Really though, on the wild Internet, there is no real protection against clone scripts. The only thing you can do is out-market your competitors.