Yeah I agree it's horrible. There's a bug for refactoring all of this because it's hard to understand and unwieldy. The good news is that getting rid of this will be much easier once all these flags are on permanently.

Line 116 means: 

If the app isn't packaged or it is both packaged and the desktop-packaged flag is enabled then desktop being true (checked) is an invalid state we don't want, in order to display the correct error on the paid tab.