You are missing the pet commands.
I would recommend guard, follow, and attack.
Before you start target yourself and tell your pet to guard you.
/ui action cycleTargetOutward;
/attack
/tellpet attack (or whatever your pet 'attack' command is)
/pause 10
/tellpet follow (or whatever your pet 'follow me' command is)
/ui action toolbarSlot00;
You want the follow line in there so the pet doesn't get too far away.
You want to use the tellpet commands so you don't spam them in say shout or yell. Plus tellpet commands work long range too.