There is a UDF here that might help: UserGroups() - returns all groups of a given user

And here is kind of a skeleton of what you might do to get started(untested)

Code:
 

$yourdomain="Test"
$findstr="LOC"
$groups=usergroups($yourdomain,@userid)
$counter=0
while $counter<=ubound($groups) and $found<>1
if instr($groups[$counter],$findstr)>0
$found=1

; your
;
; code
;
; here
;

endif
$counter=$counter + 1
loop