Code:
var %a = a b c d e f g h i j k l m n o p q r s t u v w x y z
while %a {
if $str($gettok(%a,1,32),4) isin $1- {
echo -a $gettok(%a,1,32)
}
var %a = $remtok(%a,$gettok(%a,1,32),1,32)
}
  

Not knowing exactly why you're searching for 4 character repeats, the above code might work...might not be shorter than how you were doing it, but ....