There isn't a cheat that rewrites a pet's behaviour or teaches commands directly. What the code list does include are cosmetic options — different coat colours and collars.
Behaviour in The Sims 2: Pets is driven by needs and training objects rather than a toggle, so the practical route is using the training items in the buy menu and keeping the pet's needs met.