Two things that seems similar to me :
The first one works :
action:
- delay: "00:{{ states('input_number.interval') | int }}:00"
The second one doesn’t work :
- condition: state
entity_id: binary_sensor.XXXXX
state: "off"
for: "00:{{ states('input_number.interval') | int }}:00"
This could be useful to enable a little more interactivity in fine tuning of automation without having to return changing yaml config file.