Unter the Mikrotik Wiki for Scripting (https://wiki.mikrotik.com/wiki/Manual:Scripting)
The Syntax for the "IF" Command states:
:if(<condition>) do={<commands>} else={<commands>} <expression>
shouldn't there be a space after the :if and before the (
Like this?
:if (<condition>) do={<commands>} else={<commands>} <expression>