Here is a re-done version of the recently closed pull request for this functionality, based on the the latest clean HEAD. Also tidied up a few things and added more explicit tests around the tokens themselves.
Note, this will have an unexpected effect on someone who is already using ghost, since it will start ignoring their previously entered entries. They'd have to re-add things, or add the #ghost start and # ghost end comments to the hosts file. Probably worth mentioning in the docs.
# ghost end
only change /etc/hosts between control tokens
affects only linux version because dscl is used on OSX
puts '# ghost start' and '# ghost end' comments in the hostsfile on
first run, and only changes lines in between these tokens thereafter.