Need help in creating wait_for_trigger using for loop

#1: You cannot, currently, live-build yaml using templates. See also

There are some experiments on that front, but they are not core HA functions.

#2: You cannot use templates in Device actions… switch to a Call service action, as shown in all the examples in the document you linked in your original post.

You can streamline your Wait-for-trigger action by assigning the context ID value to the notify event data alias key… that way you do not need to have individual wait triggers for each action.

sequence:
  - service: notify.mobile_app
    data:
      message: Test Message
      title: Test Title
      data:
        alias: "{{ context.id }}"
        persistent: true
        actions:
          - action: action_1
            title: Title 1
          - action: action_2
            title: Title 2
          - action: action_3
            title: Title 3
  - wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
        event_data:
          alias: "{{ context.id }}"
    timeout: "00:05:00"
    continue_on_timeout: false
  - service: input_select.select_option
    target:
      entity_id: input_select.testinputselect
    data:
      option: |
        {{ wait.trigger.event.data.action }}
mode: parallel