If I am understanding everything correctly this should make a sensor that updates the state whenever there is a ZHA event that alters the degrees of the ZHA object. Unfortunately I am getting a ‘trigger’ is undefined error message.
You should have quotes around the event type like you had originally, but the indenting needed to be fixed like finity said.
This looks like the Aqara tilt sensor; I have config you can reference here.
Edit: I stand corrected. It looks like it doesn’t matter whether or not you use quotes around the event_type. Which leaves me wondering why your template isn’t working. What else does the log say? And are you certain you aren’t using that unique_id (garage_door_tilt) elsewhere in your config? The error you mentioned means that the trigger variable isn’t populated with data, which doesn’t seem possible if the only trigger for this template is what you’ve shown.
Where are you getting that message? It kind of sounds like you are trying to test the sensor in the Template editor, which will not work for trigger-based values.