It sounds like the dog is in pain. The in and out routine could be anxiety due to the pain. Our puppies are quite stoic.You should have Xrays taken (or an Ultrasound) especially in the area where it yelped. Also have a blood panel run.