Rather than use software, you can use informal techniques such as these:
1. Go to Facebook and MySpace, but then minimize the windows. You'll feel like you have the sites open, but you just don't happen to be looking at them at the moment.
2. Set aside a time that you can use Facebook and MySpace. Set an alarm to alert you when it's that time. That lets you use them as a reward, but only once the clock says it's ok. After a time limit, you have to get back to work.
3. Have a friend in charge of checking on you periodically, without notice, and rapping your knuckles with a ruler, or maybe charging you a dollar, if you are on Facebook or MySpace.
As a technical solution, I thought you could prevent your web browser from finding the sites by putting lines like these:
0.0.0.0 www.facebook.com
0.0.0.0 www.myspace.com
in file /private/etc/hosts (which you can edit in Terminal if you know how), but that trick didn't work for me when I tried it just now.

I even tried to flush the cache with the "lookupd -flushcache" command, but that didn't help. I'm puzzled and looking for clues why that didn't work.