Hi
If i understund well you want to add as well the token that search in the text.
this is the text "|test1|test2|test3|test4|" and the token will be the "|"/$chr(124)
//var %x test1|test2|test3|test4 | echo -s $addtok( $gettok( %x, 1, 124), |, 0)
This will search for the 1 $chr(124) token and add a | to the end off the match.
Hope it was this what you want.
Good luck