You can get a core dump when your php script crashes or has errors: http://en.wikipedia.org/wiki/Core_dump We've been working to stop core dump files but it seems it's not that easy some times. Lately I haven't noticed any on my site but I also run that same script weekly with a cron so maybe I missed them? Check your site periodically for a few weeks and see if you still get them.
Yes I am sure. It will only delete core files and that's it. If your still worried, you can comment this line out here and it will show the files that will be deleted: unlink("$path"); like this: # unlink("$path"); Don't forget to go back and uncomment that line and then run the script again.