I usually just enabled the second VDC, write a small string of bytes to vram to VDC1 and then a different set to VDC2. If the SGX is present, then I'll be able to read back two different strings. In PCE mode, writing to VDC2 ports are just mirrored VDC1 ports, so it's the same string.
IIRC, you can't check for the absence of SGX extended ram because I believe that's always available on SGX regardless if it's in SGX mode or PCE mode (that little switch in the back). That check will only tell if you're running on a PCE vs SGX, and not if the SGX is in PCE mode.
Although you can probably load up an SGX rom in mednafen and step through the debugger as the game boots and see what detection routines they use.