I think he wanted %final to store the value of %varN, not the "%varN" name. At least that's what his code does, in an unecessarily lengthy way. The two inner pairs of brackets construct the variable name and the outer pair evaluates it.
ThunderWalker: there are tons of posts about both setting and retrieving the value of dynamic variables, use
Search to find them.