You're combining two different methods of using the $+ concatenation method. Each one by itself would work, but combining them does not

Try set %userchans $reptok(%a,$+(%chan,*),$+($chan,$chr(124),$ctime),1,32)