Generally, you should use visudo to edit the sudoers file, since it does syntax validation and makes backups for you. If you want to automate this in a bash script (which seems kind of shady...), you can treat it like any text file, really. Just be sure you get the syntax right.
It sounds like you must use 'visudo', just as the error message says.
visudo is an interactive application for editing and verifying the data and integrity of the sudoers file. I don't know whether it can be scripted -- if it cannot be scripted, then you will not be able to use visudo to edit the sudoers file in a script... period.
What you could do is make a copy of the sudoers file, edit the copy of the sudoers file, use visudo to verify the contents of the copy of the sudoers file (the man page for visudo explains this in great detail), then use root access to overwrite the original sudoers file with the edited copy.
The problem was that my code snippet had a tab in it, which didn't paste properly into Terminal. Make sure there's whitespace (a space will do, it doesn't need to be a tab) between the first two 'ALL's.