So, it looks like the simplest approach to handle some weird situations is to not link the item to the vbscode at all if GLOBALMEMBERS is set; this includes some corner cases with both GLOBALMEMBERS and CODEONLY, as well as returning the global script dispatch, or the global host (disp).
I will send updated patches for both this and jscript, after the CODEONLY patch is committed, since the tests will depend on it.