Because your code actually does change the target, and then changes it back. Doing what I suggested and using /useabilityonplayer instead does not change the target, so it is more efficient. And besides you asked how to code for useabilityonplayer in the OP.
If you want to go the /target_previous route however let me suggest you add this code to the buttons:
OnHoverIn="target_allow_pet_member_toggle 0" OnHoverOut="target_allow_pet_member_toggle 1"
This is what I had developed for ProfitUI 3.x before /useabilityonplayer was introduced. Without this code you may end up curing pets if you have classes with pets in your group, which was a problem for click to cure buttons at the time (good ol' times
). So this code is pretty much required, but you can see that it costs even more efficiency, so I do recommend you use the useabilityonplayer route if you can.
EDIT to add: If you play with people with non-ASCII characters in their names you are forced to take the /useability /target_previous route btw because the EQ2 scripting language does not handle non-ASCII characters.
EDIT2: I see you already released it anyway. Coercers have manaflow too btw.