Second solution. This time based on bluetooth.
Download Bluetooth Proximity Tasker. Sorry mate, but it's $2.99.
Run any AppleScript when a paired bluetooth device goes in and out of range. Adjust the range using signal strength.
Select your BT device and paste this script on In Range Applescript
:
tell application "System Events"
tell process "Messages"
tell menu bar 1
tell menu bar item "Messages"
tell menu "Messages"
tell menu item "My Status"
tell menu "My Status"
click menu item "Available"
end if
end tell
end tell
end tell
end tell
end tell
end tell
end tell
Replace Available
with Away
in the script and paste on Out Of Range Applescript
.