Foam can be hot to sleep upon, so make sure you have more than a sheet between you and it. Yes, sleeping in one position, especially if it's the wrong position, can certainly get to you. Also, be careful of bedsores when lying in bed for long periods of time. (Pressure point sores etc.)
It's very difficult for pain patients to obtain RESTORATIVE sleep. Keep working at it, it's very important and you all know.