To achieve environment-specific logic in ISC rules, reference the Source/Application object that the rule is running against, as this object is an input to the Attribute Generator Rule.
You will add a custom attribute to the target application in each environment to define the required suffix.
You can write and test one rule file. When you migrate the rule from Sandbox to Production, the rule is identical, which simplifies the promotion process.
The environment-specific data is stored in the application configuration, not hard-coded in the rule.
If you introduce a third environment later, you can just create the source and set a new upnSuffix attribute on that source without touching the rule logic.