I think you've done everything flawlessly. Taking the dog to the shelter, adopting him legally, having him microchipped.
If the original owners ever contact you regarding the dog, I'd simply stress that you adopted him through the shelter and you have papers showing that he is legally yours.
The fact that the dog seemed reasonably happy to be petted by the boy indicates that HE at least was not mean to the dog, even though the parents may have been unbelievably neglectful. I see that as a good sign and am glad, at least for now, that you're allowing the boy and dog to have a relationship. I would not extend that to the parents though.
You have a good heart. Rocky has found the right home.