Ok Lingy these are your options:
First thing is first though. If you can sweetspot before they get to the edge to edge hog, Do it. If they Are edge hogging already, Don't up+B until you have to. If you can make it into the stage with just a jump and air dodge, that could be a better choice.
Now assuming you have to Up+B.
Above the edge: You have the most options here. You can sweetspot your up B, if you suspect they are going to hold the edge and not jump over quick assuming you tele'd into the middle; Then I suggest Getting as level with zeldas feet to the Stage ground as possible. And Getting as far horizontally into the stage as possible. That way you have less falling time + more distance away from edge. Keep note if they are chasing you don't always choose the same defense. Roll - SPot dodge(Iffy) - Shield are probably the best choices, if they can't catch you fast enough just run away or do w/e cuz now you can reset the approach game.
Now that isn't all you can do above the edge. You can also angle it diagnally into the edge so your character is standing RIGHT on the edge. Sometimes this will give you enough time to shield. Because, if they waited to make sure you hit the ledge, you can probably shield when they finally try and come over and hit you. Or if your opponent memorized your horizontal distance, you can shorten the distance you land on the stage by aiming zelda at the floor. (Don't forget platforms, and other edges if available) Examples: Barrel(Jungle Japes 64), Corneria the Tail part, any platform on platform stages, If you play brinstar enough to know it like a robot, sometimes aiming at the lava intentionally so it pops you up as a hit, so you can tech once u land on land. Assuming you knwo how high the lava will send you. Too high and your asking for a free whooping.
Below the edge: Your kinda boned here. Because you either are going to 1.) Land really close to the edge on ur feet so they can come over and punish your lag(More likely to have falling lag as well). Or you grab the edge and potentially get edge hogged. Avoid this situation by DI'ing up alot when your hit, But careful about doing it, don't wanna star K.O. when you shoulda DI'd different.