The usage of $addtok will prevent duplicate items.

From the help file
Quote:
Adds a token to the end of text but only if it's not already in text.


The usage of inc %n in that code is irrelevant (unless it's being used elsewhere for something)