The reason it won't work is that when you press it the next time it will try to cast Misdirection again, but it's on cooldown, and therefore the macro stops there.
Try something with a castsequence instead. Perhaps:
/castsequence [@pet,nodead,exists] Misdirection, Hunter's Mark
/petattack
I'm not playing any more so I can't check that I got the syntax right, but the idea is to use /castsequence to advance the spell choice. First time you press it it will attempt to cast Misdirection, and moves the what-bit-am-I-up-to-in-the-sequence marker to the Hunter's Mark, and since Misdirection was successful, it will execute the /petattack too. The second time you press the button it will cast Hunter's Mark and reset the sequence back to Misdirection, and again, also execute /petattack. Or this is the theory at least
