>  to sum up as I understand the situation: in browser we have this === window and no global, in server-side node we have global !== this === module.exports and no window and in browserify we have this === module.exports and window === global. Am I right?

Yes, you are correct.

> We still want for server-side node with window & window.document defined for require('jquery') to return the jQuery object and not the factory, so passing global if present would break such a use case.

This is not actually what you currently have.  What you currently have is that this code is never triggered, since in node `this === module.exports` and since `module.exports` cannot be modified in advance of jQuery being evaluated it also follows that `this.document === undefined` so you won't get the behavior you currently think you do.