You can shorten the line after the /while with this:
var %w = $v1, %n = $addtok(%n,$+($iif($left($remove($nick(#,%w).pnick,%w),1),$v1),%w),32)
Just a suggestion. =)