figure that when a female has her pre-lay shed, she's anywhere from 1-14 days away (on average). Granted, some females lay when blue, but that isn't the point here. If she still hasn't laid at around 21 days, I'd take her to a vet WITH herp experience or a reptile shop who breeds their own animals. There are a lot of vets out there who think they know what they're doing when it comes to reptiles - MAKE SURE you go to a vet who knows what the hell they're doing...I used to work for a vet that wanted to do full surgery for an egg-bound female king when aspirating the egg should have been tried first. Upon informing her of this she promptly scoffed at my own experience (I've successfully aspirated once which was more than she had done), charged some ridiculous amount and killed the snake during the operation. Needless to say neither the owner nor myself were pleased and I calmly walked away from that job.
Do not attempt an egg aspiration by yourself...having someone who has done it before is the best way so you can learn from them, having someone there to hold the animal at the very least is essential. If the vet is going to aspirate, ask to be present so that you can watch and learn.
How to avoid it? My personal belief and observation is that if the snake gets enough exercise that it greatly lessens the chance. After losing 1 female and aspirating the second, I set up a "playpen" with branches that everyone gets to slither on a couple times a week at minimum. Since then, no more problems.
Will this work for everyone? I don't know. Is it worth a try? Why not? It will prolly make your snakes happier at the very least.