The InstanceName should contain QA, UAT, Dev, etc.
There is no straight forward way for this.
You can check by InstanceName in the Organization field:
SELECT InstanceName FROM Organization
The best solution I can offer is to include sandbox type in the sandbox type when creating them.
So if you have the following environments:
You will be able to query the Organization. Name to find the current environment type.
It's pretty messy and requires the use of a naming convention in order to work, but I think it's the easiest way for now. Probably worth a post on the Ideas site, as it would be a pretty useful feature.