What do you mean with "enabled in the P3D menu" ?
If you mean enabled through the default Options->Addon menu of the sim, you can check its status like any other addon, by checking its entry under both
%PROGRAMDATA%\Lockheed Martin\Prepar3d v4\add-ons.cfg
%APPDATA%\Lockheed Martin\Prepar3d v4\add-ons.cfg
And check the "ACTIVE" status of that file for the Addon Manager entry.
You need to check both locations, since it might be in either, depending how the sim was uninstalled/reinstalled and if auto-discovery of addons was used or not.
However, this will only tell you if the Addon Manager is enabled, which might not necessarily mean GSX is enabled, since the Addon Manager might be running even if you only install a single FSDT scenery, not using GSX.
If, instead, with "enabled" if you mean it hasn't been disabled from the GSX sub-menu under the "Addons" menu of the sim, then you can check this file:
%APPDATA%\Virtuali\Couatladdons.INI
and check the value of the "disable" parameter under the [GSX] section of the .INI file. If it's 0, it means GSX hasn't been disabled from that menu.