Headstands require core and upper body strength so you're not supporting your entire body weight with your head and neck. But this pose can cause compression to your neck.....as that part of your spine isn't designed to support your body weight. So I don't think it really strenghtens the neck muscles, as you're using mostly your core, spine arms and shoulders.
Anyways, probably good to check with your doctor first before attempting headstand again. And I wish you good luck if you start practicing again:)
I only practice headstand in this particular postion with my forearms on the ground in a tripod and my palms protecting my head. I feel like this is a secure, safe way to practice the pose as it doesn't hurt my head and my forearms provide extra support.