How Smash DI helps edge teching :
When you get hit near the edge, for example by Marth's f-smash, your trajectory don't send you into the wall at all.
At middle %, a simple ASDI towards the stage will make you hit the wall, as long as you aren't sent away too fast. It works just like how ASDIing down makes you stay grounded .
However, at higher %age, this won't be enough. Moreover, the more damage you get from the hit, the longer you'll stay in hitlag before you tech, which means a more difficult timing for pressing L, because those hitlag frames are removed from the 20 frames window for the tech.
Now, if you learn to press L and do a Smash DI around 15-20 frames later, the tech will be guaranteed :
Instead of waiting for hitlag to end and use ASDI to touch the wall, the hitlag will transfer into teching the moment you did the smash DI.
This is very easy : Press L, then slam the stick towards the stage. Regardless of what your opponent is doing, it'll most likely work.
As to what happens afterwards, the moment when you tech doesn't matter, everything will be as if you only teched at the end of the hitlag : you will start moving again at the end of the hitlag and you'll still have invincibility frames then.
I think that using smash DI also makes wall-jumping easier since you have more time (the remaining hitlag frames) to press up on the control stick.