Hi Farayi
The ActionListops widget is designed for this kind of operation and simplifies code considerably -- to search and replace a tag use with the replace[] filter operator like so:
<$button>
<$list filter="[tag[oldtag]]">
<$action-listops $tags="newtag +[replace[oldtag]]"/>
</$list>
Do This
</$button>
-- the $tags filter will operate on the 'tags' field of the current tiddler
-- the 'newtag' entry appends the tag to replace with to the end of the list
-- the replace[oldtag] filter operator searches for 'oldtag' and replaces it with the last item in the list ('newtag' in this case)
-- the list filter is used to select the list of tiddlers to operate on (this may be any listing -- in this case the list of tiddlers with 'oldtag')
Hope this helps
regards