If I understood correctly it should be as simple as having an extra file setup to replace your hosts file say /etc/hosts.override and put all your blocked hosts there along with your regular hosts file.
Then you just add a 30 minute cron job to do
cp /etc/hosts.override /etc/hosts