Recommended class to get gateway address

Yes, but if you're planning to read [System]Client/Network/GatewayAddress, that won't do any good. That tag only exists in the client & designer scope, where it will just return the same result as the code I posted further up stream.

For programatically reading a tag, see this thread, except instead of browseAsync you'll be calling readAsync: