Accidentally added a character outside of a comment in sudo file on Mac, sudo not working any more

You'll need to find an alternate means of elevating privileges, which is intentionally hard "because security." :) Since this is a Mac, one way is to reboot and hold down command+R to get into the rescue shell, and then start a terminal (it's in the utilities menu, IIRC) where you will have a root shell which can edit the pam file.

Another possible way is to copy the pam file to your home directory, correct it, then copy the file using the Finder (open /etc by selecting "go", then "go to folder" in the finder menu). I'm pretty sure that doesn't use the sudoers pam file to control access, but I don't recall for sure. You may also need to repair permissions after copying this way.

Either way: today's valuable sysadmin lesson is that, when editing pam files, you should always leave the editor window open until you've tested your changes. Save the file without exiting, and in another window (or from another machine, as the case may be), verify that things work. Only then do you exit the editor. :)