If pUnit = gc.getUnitInfo(eUnit) – then, yes, that would be my best bet. And I agree that going via the unit class is a good way to deal with unique settler units.
That looks correct to me then.the intention is no more settler after 5 cities, and only colonist from 6 to 7 cities, and neither of both after 7 cities