Is there a special variable that references the assigned ephemeral external IP address so I can define it in the startup script?
If your VM start with an ephemeral IP, you can get it directly from the metadata server at this path /instance/network-interfaces/0/access-configs/0/external-ip
In your startup script, you can include that line if you want to get it
curl -H "Metadata-Flavor: Google" http://metadata.google.internal/computeMetadata/v1/instance/network-interfaces/0/access-configs/0/external-ip