Another option...

If for example you'd like the Blueberry to engage a mob, and then start casting once its fighting and has some threat, try this.

#show
/assist Greed
/petattack
/castsequence reset=combat/target ,Curse of Agony, Corruption, Shadow Bolt, Lifetap, Shadow Bolt, Shadow Bolt, Shadow Bolt, Shadow Bolt, Life Tap, Shadow Bolt, Shadow Bolt, Shadow Bolt

The first press assists Greed and has the pet attack. The second press (which you can delay) will cast Agony etc...