This is actually not a bad idea, considering that pretty much everyone uses distributed version control now. Set the timer for an hour, commit commit commit, push, read hackernews, repeat. :)
It would be easy for the service to reject port 80 but allow the port used by the version-control system.
More difficult would be allowing access to programming documentation on the web while rejecting time-wasting web sites. One idea is to reject any web page that has changed in the last 24 hours on the theory that the time-wasting sites are constantly changing (are topical) whereas the sites you need to do your work are not. (I do not know if it possible programatically to determine when a page last changed.)
Honestly, I just removed reddit from my bookmarks toolbar, and make a conscious effort to not go there. That has made me much more productive even during "downtime". The side effect is that I post here more, but at least there is the lock out feature if I notice I'm wasting too much time here ;)