Half lotus is a bad posture, in handling pain, I change to Myanmar style or probably is called quarter-lotus? I presume is both foot on the floor, some call Myanmar style; or in Chinese, direct translation would be scattered?
Balancing and natural are the key words.
If the shoulder tension occurs frequently, and elbow is already away from body, and spinal already straight, there is one more location one might want to scan. The Leg may appear to be balance, possibility is the one that is external is slightly ‘floating’; the flesh is not resting on the floor so not able to help in sharing the weight. This could be the cause for the leaning to the side. If this is the case, even though the tension of the shoulder is released, it will come back very soon. Try to scan the muscle of the external leg, release the tension, relax it. If the tension comes back soon also, slowly switch leg; but maintain knowing your object (mindful).
Floating leg also cause another problem. The location of concern is the pressing point of the triangular pelvic bone that causes pain; normally happen when sitting for 1~2 hours per session and 5~6 sessions in a day. Once continue for more than a week, it will be difficult to sit more than 20 minutes without changing leg; that’s what happen to me. Direct solution is mindfully switches to standing meditation for a while than mindfully back to sitting.
Long term solution, what I would suggest is (there is only 1 that I’m aware of at the moment); Butterfly!
I prefer to put my buttock on an inch height small piece of cushion, place the foot facing each other close to the private part, on the floor. Both hand pressing down the knee on the floor a few times and rest; repeat a few times. Try that a few sessions, morning and night; and when it is more comfortable, maintain butterfly posture and try to lean forward to the front until the body down touches the floor flat and hand straight forward on the floor; hold your breath for a few counts that is comfortable. Repeat a few times.
If you do this down to the floor part of stretching exercise, don’t forget to stand up straight, slowly raise your hand straight up then bend your body backward. Reverse that action until your hand is straight down and relax.
May need to do this simple yoga for quite some time before both legs can be able to be flat on the floor; after that there will be less localized pelvic bone pressing point, stable, so spinal can maintain straight longer period. There will be no tension on the leg that reflected on the shoulder muscle tension.
Neck pain at the back is mostly one sided. Afaik, the root cause is not physical; rather mental. Both side back pain can be both, physical and mental. Physical is straight forward, you can see that some meditator purposely bend their head downward slightly. With that ‘intention’ in the consciousness, unknowingly, he will slowly bend down the head further especially if he is ‘concentrating’. Another mentality issue I encounter at a retreat that I joined, I noticed a sitter even bend his head almost 90 degree. I advised him not to do that; ‘I can follow the breath better’ that was the answer. This part is physical inflicted but the root cause is mentality.
The second root cause is strong viriya, when the consciousness concentrates; focus onto the breath especially when it is on one sided nostril hole. One can not avoid this problem if he continues to use senses to meditate. Concentrate and focus is wrong, resulted in strong viriya; has complication and side effects. One of it is the one sided pain on the back of the neck, like the nerve being prick and pull by a needle.
As for what is the correct way of meditation on knowing the breath, I’m afraid not much I could share, it is better to refer to your meditation teacher; apology for that!
Above pain, I personally had encountered. One more pain experience to share; presumably externally inflicted: mosquito bite!
When in deep ‘concentration’, all of a sudden, a mosquito bites right on the back of my neck. It was very very painful like a big needle poking my neck. Ignore it and I continue ‘to concentrate’ on the breath. 1 hour after the session; I touch that spot with my hand and to my surprise, there was a small piece of hard particle which is actually a blackhead exit from a blocked pore. Yet the tension on the neck was not being felt due to pain threshold built up or mental choice of isolation attention; despite the fact that tremendous tension has already built up slowly to the extend that blackhead can be forced out on its own. Imagine what kind of strength was that and yet no tension was felt prior to the ‘poking’ moment.
Has anyone compress his neck while meditation and yet during sitting he does not felt the pain at all? That happen once and I found difficulty to eat, and was unable to utter voice for 2 days; cause by a single sitting. So don't built up threshold, bad, bad very bad!