Applescript: Comparing variable to string is failing
When you have a list/array of variables and you iterate(repeat) over them, you are getting references to each item - such as "item 1 of names". In other words, you don't directly get the value, you get a pointer to the item in the array. You have to coerce the item reference to it's actual value to compare it.

Try:
if ((currentName as string) is equal to "Top_CPU_Processes) then

Also, if you are using Script Debugger, it's a lot easier to see what goes on with the script, it has much much better debug capability than the Applescript Editor.