Android (supposedly) already has that feature. From the about page for Jellybean 4.2[1]:
> A new setting lets you stay on mobile data and avoid nearby Wi-Fi networks with poor connections.
Weirdly this seems to be off by default. In Wifi settings go to the more options drop-down and tap Advanced, and it's in that list. Give it a try!