Automation one step at a time

Sorry in advance if this something someone has already covered but…

Is it possible to write an automation with several actions, where the next action does not trigger until the one above is complete, for example I have this simple automation below that checks the doors are locked at 9pm, then calls out on a couple of devices if they are not, the problem is, it is trying to do it all at once, that’s fine if only one door is unlocked but it’s getting a bit muddled if more than one is unlocked, I am aware I can write one for each door with maybe a few minutes gap between each, but there are other automations that I would like to do this with.

alias: GA-Check-Doors-Locked
description: ""
trigger:
  - platform: time
    at: "21:00:00"
condition:
  - condition: state
    entity_id: input_boolean.party_mode
    state: "off"
action:
  - if:
      - condition: device
        device_id: 7b6e21110902fc25bea3b2bf3c35a6d4
        domain: lock
        entity_id: lock.lounge_door
        type: is_unlocked
    then:
      - service: media_player.play_media
        target:
          entity_id: media_player.lounge_display
        data:
          media_content_id: >-
            media-source://tts/cloud?message=The+lounge+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
          media_content_type: provider
        metadata:
          title: >-
            The lounge door needs locking, please pull up the handle fully,
            Thank you.
          thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
          media_class: app
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://tts
            - media_content_type: provider
              media_content_id: >-
                media-source://tts/cloud?message=The+lounge+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
      - service: media_player.play_media
        target:
          entity_id: media_player.living_room_display
        data:
          media_content_id: >-
            media-source://tts/cloud?message=The+lounge+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
          media_content_type: provider
        metadata:
          title: >-
            The lounge door needs locking, please pull up the handle fully,
            Thank you.
          thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
          media_class: app
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://tts
            - media_content_type: provider
              media_content_id: >-
                media-source://tts/cloud?message=The+lounge+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
  - if:
      - condition: device
        device_id: b1bd6911a807ce1eca63257272887d75
        domain: lock
        entity_id: lock.spa_room
        type: is_unlocked
    then:
      - service: media_player.play_media
        target:
          entity_id: media_player.lounge_display
        data:
          media_content_id: >-
            media-source://tts/cloud?message=The+Spa+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
          media_content_type: provider
        metadata:
          title: >-
            The Spa door needs locking, please pull up the handle fully, Thank
            you.
          thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
          media_class: app
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://tts
            - media_content_type: provider
              media_content_id: >-
                media-source://tts/cloud?message=The+Spa+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
      - service: media_player.play_media
        target:
          entity_id: media_player.living_room_display
        data:
          media_content_id: >-
            media-source://tts/cloud?message=The+Spa+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
          media_content_type: provider
        metadata:
          title: >-
            The Spa door needs locking, please pull up the handle fully, Thank
            you.
          thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
          media_class: app
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://tts
            - media_content_type: provider
              media_content_id: >-
                media-source://tts/cloud?message=The+Spa+door+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
  - if:
      - condition: device
        device_id: 2466d04b66297e4ee23a2f6c826a963f
        domain: lock
        entity_id: lock.living_room_door
        type: is_unlocked
    then:
      - service: media_player.play_media
        target:
          entity_id: media_player.living_room_display
        data:
          media_content_id: >-
            media-source://tts/cloud?message=The+door+in+here+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
          media_content_type: provider
        metadata:
          title: >-
            The door in here needs locking, please pull up the handle fully,
            Thank you.
          thumbnail: https://brands.home-assistant.io/_/cloud/logo.png
          media_class: app
          children_media_class: null
          navigateIds:
            - {}
            - media_content_type: app
              media_content_id: media-source://tts
            - media_content_type: provider
              media_content_id: >-
                media-source://tts/cloud?message=The+door+in+here+needs+locking%2C+please+pull+up+the+handle+fully%2C+Thank+you.&language=en-IE&gender=female
mode: single

Cheers in advance.

Use a wait template between your actions. Wait for your media player to be idle.

Thank you.