Repeat until action seems to be stopping automation running?

Having some trouble here and cant figure it out! Thought this would be a simple automation to alert me when the fridge door had been left open but cant get it working. If i change the repeat to a count instead of until, it works, but i cant see anything wrong with the until part! Obviously a count doesnt help if i shut the door when its still going off! Appreciate any help!

alias: Fridge Door Open Alert
description: ''
trigger:
  - type: opened
    platform: device
    device_id: 67d05937042df2d2e0739584e7d83425
    entity_id: binary_sensor.fridge_door_contact
    domain: binary_sensor
    for:
      hours: 0
      minutes: 0
      seconds: 5
condition: []
action:
  - service: media_player.volume_set
    data:
      volume_level: 0.55
    target:
      entity_id: media_player.kitchen_echo_show
  - repeat:
      until:
        - type: is_not_open
          condition: device
          device_id: 67d05937042df2d2e0739584e7d83425
          entity_id: binary_sensor.fridge_door_contact
          domain: binary_sensor
      sequence:
        - service: media_player.play_media
          data:
            media_content_id: buzzers_pistols_01
            media_content_type: sound
          target:
            entity_id: media_player.kitchen_echo_show
  - service: media_player.volume_set
    data:
      volume_level: 0.4
    target:
      entity_id: media_player.kitchen_echo_show
mode: single

Try using a state based condition instead.

Oh… and add a delay after the sound. It could be that the message is looping so fast that the speaker doesn’t even start sounding

Ok ive tried using state conditions as well. Weirdly if i put the repeat until condition as the sensor being “on” (i.e. door is open) it plays the sound once and then stops. If i set it as “off” (i.e. door is shut) it doesnt play at all. Now im completely lost!
EDIT: also added the time delay as suggested!

Ok i think ive figured it out. I think the message to play the sound was being sent so quickly it was spamming the alexa or something so i added a 5 second delay after the sound and it seems to be working now. The sound kept playing for ages after i shut the door like it was in a queue to be played so it appeared to be a faulty loop. The 5 second buffer gave the current sound time to play before the next request was sent. Thanks for your help!

An alternative to a fixed delay is to wait until the media player changes state from playing to idle.

        - wait_for_trigger:
            - platform: state
              entity_id: media_player.kitchen_echo_show
              from: 'playing'
              to: 'idle'
          timeout: '00:00:05'

The timeout is effectively an insurance policy to ensure wait_for_trigger doesn’t wait for more than X seconds.

This technique is more useful when the duration of the media content to be played is variable. If you know the media content’s duration in advance then using a fixed delay is simpler.