Yours works thanks to De Morgans, but I find it hard to read what you are actually trying to say which is;
> If a unittest or has nochecks skip loading of -checks.js

Maybe the following is clearer?

If (!(isUnitTest() || hasFlags('nochecks'))) {}