Here’s how I solved my redirect URL that works with a Suitelet and a ClientScript. Suitelet determines the script url and then passes it to the ClientScript and then using good old JS location object to determine the correct subdomain.domain construct.