I agree that you should ensure your bike or another bike properly fits you. Good bike fit should enable you to ride for several hrs. without neck /shoulder pain or having headaches. It doesn't sound quite right that you have a need to stop and stretch during a hill ride.

Keep up stretching before and after cycling.

Are you relaxed on your bike wherever you ride? Meaning your handlebar grip not tight? Your handlebars should be shoulder-width..