If I understand correctly, then EditorUserBuildSettings.activeBuildTarget is what you should use to tell what mode the editor is in. However, the Build Settings window allows you to switch platforms only by group, so it confuses me that the type is not BuildTargetGroup.
What values can I expect from this property?