Keep in mind tags are much easier for HL to work with than strings. The simple way here is pull all the tags to yourself and then simply push them all at once to the hero. This way you don't have to deal with strings and don't care if you get one or two tags pulled.
The whole script becomes this:
Code:
~ Tag the hero has having weapon focus for each weapon
~ in order to satisfy pre-requisites for feats that
~ require weapon focus with a specific weapon.
foreach thing in BaseWep where tagids[wFtrGroup.?,"|"]
~ Pull each tag from the Thing to ourself
perform eachthing.pulltags[WepFocus.?]
nexteach
~ Push all pulled tags to the hero
perform hero.pushtags[WepFocus.?]