Macro Creation Tutorial

Is it possible to test for 2 if statements in a macro, like you would use elif in python?
So for instance:

{% if  ( printer.toolhead.position.z + 10 ) > 280 %}
   G90
   G0 X150 Y150 Z280 F24000 #Wipe out
{% elif  printer.toolhead.position.z < 40 %}
   G91
   G0 Z1 F24000
   G90
   G0 X150 Y150 Z50 F24000 #Wipe out
{% else %}
   G91
   G0 Z1 F24000
   G90
   G0 X150 Y150 F24000 #Wipe out
   G91
   G0 Z9 F24000
{% endif %}