I don't see why this would be so bad. Use the hosts file grammar. The file should have:
key WS value WS value...
The key (first value) can be anything, including a single "+". Don't worry about the +/- signs. If there's a space, then you're setting a different config.