Passing variable variable to a script

You want “data_template” to let HA know that there’s a template to render.

service: script.alarm_lights_script
  data_template:
  title: "!! ALARM !!"
  message: "{{ trigger.to_state.attributes.friendly_name }}"

Also - when posting YAML, always use preformatted text so that we can help debug formatting issues.