Repeat automation if service-script fails

Ou sorry, we misunderstand.
There is a switch, which is controlled by this script (script turns this switch on for a certain time and than turns it back off).
I checked this switch’s entity history / logbook but it does not show that it was unavailable.