Unfortunately I can totally relate. Several of my hens sleep in my nestboxes and my eggs do end up with poo on them at times.
The first question to ask (which I didn't know when I built my hen house and thus made the mistake):
Are your roosts higher than your nest boxes? Chickens will tend to roost on whichever is higher. (My roost is the same height as my upper nest boxes and thus, I believe, my problem - we are fixing it with our new addition and hope it will stop my girls from sleeping in the nest boxes).
What I've done to help stop the eggs from getting so poopy is to get out early in the morning and clean out the nestboxes before the girls start to lay their eggs. I scoop out the poop and put in fresh shavings each morning. That actually has made a huge difference with the poo issue.
I also didn't have enough roost space for my girls (because none of them want to use the lower roost - they chose the nest boxes instead.) so I'm adding lots more roost space.