Bluetooth-based presence detection is already done by Clicker and (to a lesser extent) BluePhoneMenu. There’s also some sort of opensource Clicker clone which apparently sucks but gets the job done (but I can’t remember its name offhand).