So after spending the last week fighting bluetooth after I thought I had it nailed I decided to update my applescript to make my life easier. Below you can find the latest version. It will ask for an Administrator password which is needed to turn off and on the bluetooth daemon. If you continue to have problems here are some other things to consider:
1. Bluetooth is extremely susceptible to RF interference. i.e. Bluetooth runs over 2.4ghz the same as most wireless networks today. If you are experiencing poor bluetooth audio quality you should use the 5ghz wi-fi bands if possible. If that isn’t possible try switching channels.
2. If your computer is under heavy load you may need to increase the resources available to the bluetooth daemons. The reason for this is bluetooth audio re-compresses audio data prior to sending. This is cpu intensive so if your cpu is already working overtime you are going to have problems.
Here is the new version.