I once wrote a similar script which was configurable and it installed as a service. It would periodically scan /etc/hosts to check I wasn't cheating.
$ sudo /etc/inid.d/procrastination-ctl start
OK.
$ sudo /etc/inid.d/procrastination-ctl stop
You need to wait 59 minutes before you can stop.
Managed to waste a whole day on that one.