Thank you for your help.
Seems that variables with square brackets works, when variables with {} are ignored.
For example, this tool change script won't work:
{IF NEWTOOL=0}M104 S165 T1; set T1, inactive extruder to 165 C
{IF NEWTOOL=0}M109 S220 T0; Set T0, new active extruder to 220 and wait for it to reach temperature before proceeding.
{IF NEWTOOL=1}M109 S220 T1; set T1, Heat T1 to 220
{IF NEWTOOL=1}M104 S165 T0; Cool T0 to 165