I think you're probably right, Stuart. All the modem/routers we're talking about run on Linux, and the conventional Unix way of getting details of network interfaces is the command ifconfig which is usually in the /sbin directory. If I run this command on an HG622 when it's connected to the internet, one of the interfaces is ppp256, and it does include the external IP address. What I don't know is whether the external interface is always called ppp256, or if not, what other names are used.
Obviously the output of cat /var/wan/ppp256/ipaddr is easier to parse than ifconfig, but again, I don't know how universal it is.