These are all really bad ideas. How about this? You could improvise until you make your way forward or backward to a landmark.
It's easy for me to think about improvisation. After all, I make a significant portion of my income as a church organist, and improvisation is at the heart of any successful organist's career. But maybe you don't have any experience with improvisation--especially in front of an audience.
If you do have a lapse, it may be possible to jump directly to a landmark. I find that this can work well, depending on the situation. But, in many cases, you don't have that option, so you need to have a plan. To begin, don't think of improvisation as something that you have to bring to a high artistic level. Let's save that for the jazz musicians and the great French cathedral organists. Your improvisation is going to have a very practical purpose: to get from A to B--or maybe from B to A. It doesn't need to be anything more than that.
You now know what your improvisation needs to do. Let's consider what it needs to be. First, it needs to be in the key of what you're playing, and it will need to modulate if your next landmark is in another key. If you know your landmarks well, you have a pretty good idea of what keys they start out in. Second, your improvisation should maintain the rhythm of where you are and, if necessary, transform itself to the rhythm of where you are going. Third, your improvisation should maintain the texture of the passage and, again if necessary, develop into the texture of where you're going to end up.
In other words, your improvisation needs to be in the style of what it is you're playing. In some ways, that's the easy part, and there really isn't any right or wrong. It just needs to be convincing. The harder part might be trying to modulate to another key, but that's something you can practice both physically and mentally.
It's possible to practice your improvisation in a pedantic way, working your way through various modulations and making sure that you can get from landmark to landmark. Unfortunately (or fortunately), there's not really that much time in the day to practice like this. You can also force lapses by making yourself nervous, a technique I discussed earlier.
The bottom line is that the vast majority of your audience (and, most likely, 100 percent of your audience) won't know that you're improvising. For you, the lapse moment may feel like an eternity, but you also know, quite rationally, that it's not that big of a moment. This is a game of outwitting the situation, and you have to learn to keep your cool.
This brings us back to fear. Don't forget this: Your audience is not there to hear you make mistakes. They give you the benefit of the doubt in what you are doing, and they will always assume that you are doing the right thing. They're not looking for mistakes, and they really wish you the best so that they can enjoy the performance as much as possible. All you have to do is uphold your end of the bargain by letting them think you've played a perfect performance--whether or not it's true. Keep your cool!