Changing Named Rhino Environment by Grasshopper Script?

It is possible to do so. RhinoDoc.CurrentEnvironment gives you access to setting environments. Here an older thread that goes into it.