In my head cannon, much like how the hobbit is written as a narrator telling a tale from the future, I assume Grima earned the moniker of worm tongue.
My impression was always that ‘Wormtongue’ was a derogatory nickname given to Grima by those who secretly despised him and were truly loyal to Rohan and Theoden. I never felt that it was his actual name.
Gandalf has no reason to be smug about it since he was tricked and held prisoner by someone called sauronman.
As other comments have pointed out, the name “Wormtongue” was just a nickname that those in Edoras called Gríma son of Gálmód. The name just officially stuck once Gandalf the White strolled on in and showed Théoden that Gríma was indeed a wormtongue
let’s be clear, any society that believes nomonative determinism would be considered a bit shitty.



