I haven't been following this closely, just a little note:
BTT 3.216 Alpha adds a few bluetooth predefined actions:
- Connect Bluetooth Device
- Disconnect Bluetooth Device
- Toggle Bluetooth Device
These allow to connect to arbitrary bluetooth devices including the Airpods. Might be faster than the apple script solution.
I also added a dynamic variable that let's you know about the current connection state:
It starts with BluetoothConnectionState- and then takes either the bluetooth address (xx-xx-xx-xx-xx-xx) or the name of the device (wildcards * are allowed)
tell application "BetterTouchTool"
get_number_variable "BluetoothConnectionState-*Pods*"
end tell