If you have Pretty Print Tidy set to on, and to run when you Save, then that's what it will do.
If you turn off Pretty Print Tidy on Save, then it won't run when you save. But if you then open the file it will run if you have Pretty Print on Open set, so you might as well turn it off altogether.
So, if you find you need to save invalid code, turn off Clean Source, save, then open later.
I assume what you want is to be warned, like you are warned about invalid code when switching to Book View, or even when running Reports. Otherwise your code is unexpectedly changed.
Seem's reasonable. It would probably just be an error message saying the file can't be saved as the code is invalid and Clean Source is turned on. You would then have to either fix the code or turn Clean Source off. If its just turned off automatically on save, then when you open the file it will be 'fixed'. And you would have to remember to turn Pretty Print Tidy back on after.
See the Sigil User Guide and its tutorials for details about Sigil.