Is there a way to interrupt a delay in a script?

I have a script that turns on my sprinklers, delays for a few minutes, then turns off.
Is there a way to interrupt the delay?
In other words, let’s say I start Zone 1 and the relay turns on.
I want to stop Zone 1, but I can’t because the process is stuck in the delay.

Is there a better way, like a separate script for on and off? (Where do I put the delay?)

alias: Sprinkler Zone01 run
sequence:
  - condition: state
    entity_id: input_boolean.zone1_enable
    state: 'on'
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.sprinkler1_relay_1
  - delay: '{{states(''input_number.irrigation_zone1_duration'')|int *60}}'
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.sprinkler1_relay_1
  - delay:
      hours: 0
      minutes: 0
      seconds: 1
      milliseconds: 0
mode: single

Just use the script.turn_off service to stop your script then turn off the relay.

Cool. I wonder how I missed that.

It is only applicable to scripts with delays or waits.

It’s the delay that’s messing up my flow. I can manually turn on the relay, and manually turn it off. But as long as the program flow is in the delay, I can’t turn it back on. So script.turn_off is likely exactly what I want.