Hi there, I work as a vet nurse and it's surprising the types of things dogs and cats swallow!
If he has to have surgery, he should be fine. In the 13 years I've been nursing, I've only seen one case go bad (the poor GSP got peritonitis), but that was because the owner didn't realise her dog was sick for days and days.
The dye sounds like barium, it helps to see weird objects in the gut with an xray a little better. Hopefully the little fellow will poo it out, but otherwise if he has to have it operated on, it's pretty straight forward with lots of rest until stitches out.
Keep us all posted, and good luck!! ;)