Both of my sons went through this. My one, shortly after we brought him home from the hospital. He was in horrible pain. They told us the same thing about popping it back in and tried to show me how to do it. I demanded they repair it, they did surgery and he is fine. He was only two months old and four pounds at the time, he was born premature.
My other son, he was in 7th grade, we think maybe he was born with it and it just presented itself during football training. He had surgery and was fine. He also had a vericoceile (sp). Those are vericose veins in the scrotum. That began to cause him pain last year and he had surgery on that too. All surgeries went well.
The toughest part is the anesthetic, the recovery is fairly quick. However, my one was a baby and wasn't active, the other was old enough to understand to take it easy. I'm not sure how to hold down a two year old for two to four weeks of recovery. Any surgery is scary, especially when it is our children. I will pray all goes well for you and God's healing hands are on him and with the surgeon if that needs to occur.