Referring the current automation?!

i have this code in an automation

    - service: automation.turn_off
      target:
        entity_id: automation.test
      data:
        stop_actions: false

            HERE CODE

    - service: automation.turn_on
      target:
        entity_id: automation.test

because the code in the middle generates an infinite loop. this code rollbacks changes made to an element, so the infinite loop…

how do i convert this code to be used in a blueprint?! or… how do i get the automation using the blueprint?!

thanks