im not aware of any scripts in perticular that do this (im sure there are many i just never needed one) but pretty much all stats programs (AWStats, Webalizer, etc) will show you search engine keywords.
i suppose it wouldnt be too hard to make your own script to do it, google and yahoo both send the keywords in the query string of the referrer.
just parse q=xxxx for google and p=xxxx for yahoo out of the url and you have your keyword. im sure you could check out the format of all the other search engines you are interested in seeing stats on.