- You must not use parenthesis () in conditions
- Do not quote the integers
- Equal is == not =
- If it is not in users.profile.tpl, then {PHP.usr.profile.user_maingrp} is not valid because it is defined only in users.profile.inc.php. For any template file you should use {PHP.usr.maingrp} instead which is global.
May the Source be with you!