Hurt muscles in right neck and shoulder shovelling snow. Stretching muscles hurts. Is it good to stretch sore knotted muscles?

YES! Gentle stretching can actually speed up and improve the healing of sore, knotted muscles. Try not to overdo it with painful stretches or bounce around while stretching, but gentle stretches a few times a day will loosen spasm and contraction in sore muscles after a workout. Always see a physician if muscles become extremely painful or muscle pain does not go away within 7 to 10 days.
See below. A combination of moist heat, nsaid, & gentle stretching can help relax muscle spasm, pain, & inflammation. Magnesium supplementation (low dose to prevent diarrhea) or prescription muscle relaxer may speed the healing process. Therapeutic massage can also relax & sooth sore, spastic muscles. If problem doesn't resolve or worsens, see fp or orthopedics for evaluation.