A cloaking script looks at IP address, the User-Agent string of the browser, the referring URL. The script will make a decision based on this information and serve the appropriate content to the visitor.
I thought of creating one using a google ip list i found on the web. If the ip of the visitor was found in the the ip database then the bot would be redirected to my keyword spammed pages. Otherwise my normal content would be displayed. It turned out to be too big of a project for me since there is more than one search engine and way too many ip's to get.