HI, welcome to HCM.
Definitely neck pain
was due to abnormal sleeping position. No need to worry to much . Just take a muscle relaxant
tablets like myospaz for 2 days and warm soakage.
It will be better if you change your sleeping habbit .unless it will trouble you frequently. Also it will cause long term side effect as cervical spondylosis
If swelling is persisting then need to consult your physician.
Hope i have answered your query.