And what are your expectations? The script makes sense when run periodically from scheduler. But DHCP lease script is executed only on DHCP events (acquire address, lose address).
And that should be better how exactly? Or how should it even work? If you run it from scheduler, it runs every X seconds/minutes/hours, whatever interval you used. If you add it to DHCP client, it will run once for each event. It won’t be the same at all.
My guess is that it’s not possible. If you need to check it repeatedly, then script running once is clearly not a best place for it. Unless it would accept endless loop, but it still wouldn’t be good, because you’d need to synchronize it with other DHCP events that you don’t control.
Back to beginning, what’s wrong with scheduler when you say that it works well?
Obviously changing “numbers=0” for whatever interface this is on, and the timeout to what suits. You can also Log errors as you see fit. This is at a 1 second interval by default.
You can also write this to be added when you dhcp is bound - and then also remove when unbound (important). As to how - you’ll have to research that for yourself (I recommend making one that suits - exporting and adding to dhcp-client script to simplify the process). Also you can do finds to get the variables you need - but I am deep in that hole ATM and have nothing to offer (apart from a search for comment is mostly doable).