Typically in any given place, the cell id changes between a couple of values.
I don't exactly know how to do these, maybe some fancy shell scripting could do that with ProfileMatic's "Custom action". Harmattan has automatic WiFi scanning in the background. I'm a bit uncertain what you're trying to do as it seems to me Harmattan has built-in the functionality: auto-connect to specified WiFis, disconnect once out of range.