You may have an unusual lateral ankle sprain with a condition called peroneal tendon instability. A lateral ankle sprain means the side of the ankle away from the other leg is sprained. The two peroneal tendons go down the leg and around the back of the ankle bone. The tendons set down inside a tunnel formed by bone and connective tissue called the retromalleolar groove. A fibrous band (the superior peroneal retinaculum) goes across the tendon to hold them in the groove.
When this fibrous retinaculum is ruptured, the tendons can dislocate or pop out of the groove. The result is persistent pain along the outside aspect of the ankle bones. There may be a painful popping or snapping sensation such as you mentioned.
Conservative (nonoperative) care is only possible when the unstable tendons can reposition inside the retromalleolar groove. A cast or boot placed on the lower leg will give the tendon a chance to heal. If conservative care is unable to achieve a stable gliding tendon or if the tendon displacement is unstable from the start, then surgery is necessary.
There are several different surgical options to consider. The fibrous protective sheath (retinaculum) can be reinforced or reconstructed. The groove can be reshaped (deepened) and rebuilt. The surgeon will probably suggest some additional imaging studies to determine the extent of the damage and the best way to surgically treat it. If you are still uncertain about the need for surgery, you always have the option of seeking a second opinion. There is nothing wrong with asking questions and seeking further advice.