[ticket/11816] Fix define/loop checks in IF statements containing parenthesis

PHPBB3-11816