you might wanna look at kismet.
there will be rpm's for kismet.
i've been working on a project which has a module for this. i've done the coding in C, using the wireless-tools for linux API. a shell script for doing this is the easiest - a few lines of code, to test your signal-to-noise level, and switch if needed (and possible).
also, you might know this, but connecting to networks that you arent a part of is not ...