chmod +w /etc/sudoers USERNAME ALL=(ALL) NOPASSWD: ALL chmod -w /etc/sudoers
I just looked more closely at the command you were trying to execute, and I think you are in a state that will not let you use the sudoers file anymore.
If you managed to change the sudoers file's permissions, that can disable the sudo command. The file needs to have the following permissions
-r--r----- 1 root wheel compressed 2299 Aug 22 2015 /etc/sudoers
if you managed to change them away from this setting, then the sudo command will not trust the /etc/sudoers file and refuse to operate. Also the permissions of the parent directory /etc/ need to be secure as well
drwxr-xr-x 106 root wheel - 3604 Feb 21 10:09 /etc/
Also the sudoers file is suppose to be edited using the /usr/sbin/visudo command, as it will sanity check any sudoers file changes and prevent an invalid sudoers file from being saved.
By default /usr/sbin/visudo will use the vi/Vim editor. If that is not your preferred text editor you can specify
EDITOR=/usr/bin/nano visudo
and use the nano editor (or provide emacs if that is your preferred text editor)
Back to the permissions. You may need to see if you can restore the file from a backup, but that may not work.
The alternative is to boot into single user mode
Boot holding Command-S
/sbin/mount -uw / # to make the disk read/write (be careful in this mode as you are root all the time)
/usr/sbin/visudo # to fix the sudoers file
/bin/ls -l /etc/sudoers # to check the permissions
/bin/chmod 440 /etc/sudoers # set the correct permissions if necessary (visudo may do it for you)
/sbin/reboot # when you are done