You call getIP twice
Also since you're expecting a HTTPobject to return data at the execution speed of torquescript it doesn't loving work
First refresh gets nothing because the HTTPobject is constantly getting deleted; the very last one works, second refresh the very last one's value is stored in $loc so is applied to every server
So the first refresh didn't work at all and on the second refresh, every server is from Great Britain or whatever country the last server requested was.
This is not something you can halfass like this. What you should be doing is making a list of IPs, committing them to the server as a list in one query using postdata, and getting back IP->country mappings then applying them retroactively to the list (by going through it once you get the data back). Doing it this way you could also be fancy and create guiBitmapCtrls at the appropriate positions with flags quite easily (though you'd have to resort the flags when you resort the list as well, which happens quite often so you'd want to hide the flag container during refreshes then show it again afterwards when it's sorted - but hey if you're gonna do something do it properly)