M.P.
I suffered from this sort of pain for years. I found that physical therapy helped some. If you have medical insurance it may pay for pt.
What also helped was to lay on a heating pad. Moist heat help the most. Put a damp towel/washcloth in a plastic bag and put it between your upper back/neck and the heating pad.
What has happened is that by sitting in a poor posture position you have strained the muscles. The muscles need to relax and this does take some time. For me often a couple of weeks.
Again, if you have medical coverage, I suggest seeing the doctor. What helped me most was taking a muscle relaxant. Just a couple of days of that and my pain was gone.