You may have to do some self-myofascial release in that area (or any other areas that can potentially cause/trigger the upper trapezius to tighten up).
I’d see your physician first just to rule out any other factors (such as pinched nerves) and to see if there are any existing contraindications to doing SMR (such as joint problems like arthritis).
Assuming that you are cleared for all that and you are told that it’s simply caused by muscle imbalance, then you should be good to go for applying SMR treatments. In the case of muscle imbalance, where one set of muscles are overactive and the opposing sets are underactive, you will experience tightness in the area. The sensation of tightness can be caused by the feeling of the muscle contracting, or from the feeling of the muscle being stretched out (in which case, the muscle tries its best to protect itself by applying tension to prevent being stretched out too far).
In either situation, simply stretching and strengthening isn’t sufficient to remedy the problem. Sometimes, you end up stretching the muscle perceived to be “tight,” but is actually stretched out; as a result, you further weaken the muscle (causing further instability in the area). Other times, you strengthen the muscle that is perceived to be “weak,” but is actually a tight muscle; as a result, you end up fatiguing the muscle further.
You must have someone assess your movement in the area and around it first to determine the likely cause of the tightness. Once you find out which muscles are the likely cause of overactivity, you will then be given some SMR exercises (usually in the form of foam rolling, trigger point rolling with a ball or some other massage device) to do. This will cause the overactive muscles to cease its activities. Only then will it be possible to do any kind of stretching to the area.
This is akin to trying to stretch out an elastic band that has a knot tied into it. Stretching the band won’t undo the knot, it will only make it tighter (and eventually break the band due to the limitation that the band can stretch out). However, if you undo the knot, then the band can stretch out further.
Once a stretching program has been given to you, then next step is to reactivate and strengthen the weakened muscles. The last step is to reintegrate functional movements back into the area to retrain the firing patterns of the muscles.