Toggle Bluetooth AppleScript not Working in Yosemite
Simple toggle on or off that does not need to check state first.

property thePane : "com.apple.preferences.bluetooth"

tell application "System Preferences"
    activate
    set the current pane to pane id thePane
    --delay 1
end tell

tell application "System Events"
    tell application process "System Preferences"
        try
            click button "Turn Bluetooth Off" of window "Bluetooth"
        on error
            click button "Turn Bluetooth On" of window "Bluetooth"
        end try
    end tell
end tell

tell application "System Preferences" to quit