You could probably fake this with a gimpy sort of multi-step macro. Just set up step 1 to "hang" or fail if you have no focus, and step 2 will work if you have a target. THen just have that key rotate back and forth every other keyup/keydown. Would be highly dependent on how things fail, though; might end up being too much trouble with regards to targeting things.