You are closing your loop too soon. This is the only line being ran 27 times justthisregion = finregions.remap([regionslist[i]],[1000],0);
. So justthisregion
will only end up holding whatever the last interation was. Move your }
down.
var regionsplusponds = function (regionslist){
for (var i in regionslist)
{
justthisregion = finregions.remap([regionslist[i]],[1000],0);
pndsplusthisregion = justthisregion.add(justponds);
if (pndsplusthisregion===2000)
test = finregions.remap([regionslist[i]],[2000]);
else
test = finregions.remap([regionslist[i]],[999]);
addToMap(test, {min:0, max:2000, palette:['ff0033','993366','003366'], opacity:0.5}, "Regions with Ponds");
} /* <-- this was your problem line */
};