I mean you should understand that these situations are ones where you should be punished, they're bad situations and the other person will usually get a punish even if you manage to avoid these specific moves you asked about. The best thing you can do in these cases is try and mix up between your options so that they miss their primary option and have opt for another option (which you can then mix up later with another one of your options).
so
1. "off the edge" I take to mean off stage in general. Your description is really broad so there are basic things you can do in varying situations. The most basic rule is always try and save your double jump to sweet spot grab the ledge from underneath. Avoid double jumping over the area above the ledge and try to land on stage, avoid double jumping from high and try to land center stage (do these things sparingly as mix ups).
So If you're high and off the stage you can:
Recover high and into center stage > mix up would be pulling back hard and falling to the ledge. Some people say this is a true mix up, most characters cannot cover both options with hard hits.
If you're falling towards the ledge and are going to be level with it - about 3-4 character lengths way from it (and don't have your double jump), you don't have any true mix ups but you have options to try and throw off their timing.
Mess with your recovery arc, try to go high and fall to the ledge, try to go direct and through, try to drop lower and barely make it to the ledge etc. Another option is to airdodge and try to fall to the ledge faster than they would expect.
The biggest "trick" you have is to go as low as you can and up b so that you try to grab the ledge and position your body right next to the stage's wall. Now you can SDI the fsmash inward and ledge tech it (up b or airdodge in immediately afterwards)
2. Again, really broad (50% is a huge range). At lower percents you can try to no DI and tech. At about 30% you can DI straight away from the way Fox was facing and either tech or double jump out. This of course only stops you from getting hit by an upsmash. If he tries to SHFFL you or regrab, then you have to pick DI's, tech, tech rolls, and no techs that he isn't expecting to try and weasel your way out.