For anyone finding this thread - the function is included in opnsense by now.
When adding a new cronjob, under command look for "Renew DNS for Wireguard on stale connections".
When adding a new cronjob, under command look for "Renew DNS for Wireguard on stale connections".