The frame script environment is described here. In particular:
All the frame scripts running in a tab share this global. However, any top-level variables defined by a script are not stored on the global: instead, top-level variables are stored in a special per-script object that delegates to the per-tab global. This means you don’t have to worry about global variables you define conflicting with global variables defined by another frame script. You can still access the global directly via this.
So you can act like you have your own sandbox most of the time but if you deliberately access the frame manager itself then you’re in a shared environment. If you want to stay within your own sandbox you can load the subscript within a global object that you declare, and put everything “public” as a property of that namespace object.
I’m still not sure what your complaint is. What “global environment” do you want? Your latest message seems to be complaining that you got the global environment in the frame script and that was a big problem.