Why are you using sed to do this? Maemo provides update-sudoers for a reason. Put the content that you'd like to have in sudoers into a file called "wizard-mounter.sudoers" and install that file to /etc/sudoers.d/ as part of your package. In the postinst and postrm, just run "update-sudoers". If your wizard-mounter.sudoers file is dodgy, update-sudoers doesn't update /etc/sudoers as opposed to just ruining it. Which is what is happening currently with your sed method. Simple as that.