Intel Bluetooth sometimes seems to stuck in a weird state where it cannot response to any command (e.g. Bug #1790454). Bluetooth will simply not working when this happens, and can only be fixed by unplugging the computer from any power source (reliable) or restart until it works (may took 5-10 tries for it to work).
This script simply try to unload the driver and reload it with an option to repeatly doing so (press R) until it started working. It is written for runit, so when used elsewhere you might want to replace sv stop
and sv start
lines to systemctl stop bluetooth.service
and systemctl start bluetooth.service
respectively.