So, he ate 4oz of the cake?
How much
chocolate was in the cake? Was it milk chocolate or semi-sweet or ?
Do you think he vomited up approx. the full 4 oz?
How long ago did he eat it?
Do you keep activated charcoal capsules at home (like the kind vegetarians use for like, um, gas

)?
It is your call, of course, but chocolate can kill a dog. I think it's good that he threw up...but also it's a sign that his body
IS reacting badly to the
toxicity of the chocolate, and there could still be more in his body as the chocolate stays in a dog's body for a day or more. Did you check his heart rate? What did the vet say about his heart rate?
Articles
you may want to read right now:
How Chocolate Can Poison Your Dogs Dogs Chocolate Poisoning - Chocolate Poisoning in Dogs Chocolate Poisoning in Dogs | PetMD