I can’t offer wisdom, just some common sense. It’s good to think about, mentally prepare, and train for just such a situation. The prepared mind and all that as the saying goes. If it concerns you more than just something to think, prepare, and train for, then you might want to get a level 3 style holster and train, train, train, with that so that you can quickly access the level 3 holster when needed. It adds a level of retention if anyone were to go for your weapon.
While you hear about the bad folks getting a good person’s gun and hurting them with it regularly, I would say that happens mostly when the good person isn’t as well trained or prepared as they could be. I know criminals train specifically to get police and security officers guns from their holsters. Those are usually open carry, uniformed officers. Keeping your weapon concealed unless you are actually deploying it for a situation will go a long way in keeping the situation from happening as no one would even know you had a gun.
If you are carrying at your waist, we were taught in the academy to grab the weapon with both hands, lower our center of gravity and twist back and forth hard a couple of times, yelling loudly “let go of the weapon,” and move away from the person. Lowering your center of gravity and twisting puts them at a disadvantage, hopefully enabling you to move away from them and keep your weapon.
If you could not get away, then use the weak hand to go for their eyes or throat. It is hard to fight for a weapon while someone is poking your eyes out or punching you in the throat. We were also taught to stomp on the top of the bad guy’s foot, it is a pain center that usually can disrupt an aggressors actions. Your idea to use a knife might interrupt their thought process and have them disengage. Getting a knife out, opening it, and getting it into play are fine motor skills that will take a lot of training to bring to bear in a adrenaline filled situation. For me, the pain center in the foot first, then the eyes and throat method would be easier to accomplish. That will vary though, I have a couple of friends trained in knife fighting that can use it to their advantage in adrenaline filled situations.
Along with you, I hope to hear other’s thoughts on this and maybe find some updates to the methods I described, it has been a long time since I was taught the technique and it may have been modified or improved upon.