Can AppleScript or any other script measure a Macbook's wifi signal strength?
If your main priority is to have your Mac automatically switch to next strongest access point.....

Your Mac can do that for you already.

Of course you have to have set up both routers as Automatically Join and at the top of your list.

Then tell it to roam and it will automatically connect to next stronger signal network.

Even better is if your SSID and WPA are the same for both.

To turn the roaming on in case it was off do this in Terminal:

sudo defaults write /Library/Preferences/com.apple.airport.opproam enabled -bool true


Then set it up to automatically join next strongest access point

sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport prefs joinMode=Strongest


You are done, now you can move around and your Mac will keep you connected to the strongest signal.

More reading material here 

And Apple explains it how it works 

If you still prefer scripting this process here is the list of Airport commands /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport