This script was a workaround for a DS-Lite + PPPoE + DHCPv6-PD problem on OPNsense. It is no longer needed. Using it on a current OPNsense will likely make things worse, not better.
On the WAN interface, set IPv4 Configuration Type = None (not PPPoE). Keep IPv6 on DHCPv6 and configure PPPoE as a separate device under Interfaces → Point-to-Point → Devices. That's it — OPNsense's standard dhcp6c path handles everything from there.
The mistake (in case it helps you, fellow pfSense-refugee): replicating the pfSense convention of IPv4 = PPPoE makes OPNsense wait for an IPv4 address that, on DS-Lite, never arrives — which blocks the DHCPv6-PD path that actually carries your connectivity.