/script if IsPetSummoned(Х) then ReturnPet(Х) else SummonPet(Х) end
где Х - номер слота с нужным вам петом