Do the logic that determines whether to build a settler or not and the logic that determines whether settling locations are suitable communicate at all? I don't recall that being discussed and to me it often feel like the AI just decides it's time to build a settler no matter if the available locations are really poor (strategically or yields wise) and once the settler is out it has to plop it no matter what.
Followup to this question: they do decide whether to build a settler or not based on whether a spot is available, but may keep one in reserve (according to ilteroi).