The navigator.javaEnabled() method should be all you need. I would not bother with checking the Java version. Firefox disables Java automatically because of the vunerability so javaEnabled should be false in that case and using Geogebra with an outdated plugin or browser is probably not a security issue. If Geogebra will not run because of Java, users should be prompted to upgrade Java or they can disable Java manually and go with Jsxgraph which may be good for them again for security reasons.
My question is if inserting a string is what you are doing for the editor plugin thus enabling support for mobile devices, couldn't this be done also by the geobebra filter. In which case the plugin does not need to distinguish between whether it outputs a jsxgraph string or a geobebra file. The filter would fix it.