There seems to be an issue affecting some Macs (an early-2009 Mac mini in my case) where the Wi-Fi will drop and will not attempt to reconnect to the network – only manually selecting the network will work again.
This is a simple AppleScript that checks if OS X / macOS has disconnected from your Wi-Fi network and will attempt to reconnect after some time interval.