Poorly written that it had chmod all over the place and you didn't notice? What the hell?
Also, learn cronjob. You could have added something quickly to restart your computer every set period of time (e.g. every saturday at 4:00am or whatever).
I'm guessing OSX has cronjob (or something similar). If not? Lame.