One thing I'd add to this is to schedule it in the future. Sometimes, you can't bring yourself to block all websites right now, but you can happily make it a problem for your future self. I've written a similar script to do this and had success with it.
This is an excellent application of George Ainslie’s concept of future reward discounting. Very powerful concept that can be fruitfully applied to all sorts of things in life: http://www.picoeconomics.org/
Something like:
checking 60m --start-in 30m