You want to press L less than 20 frames before you hit the wall. The difference between SDI and ASDI is when you hit the wall. When You SDI, you can hit the wall, and hence tech, during the hitlag of the move you're being attacked with. ASDI happens on the first frame after hitlag is over.
ASDI is inferior for three reasons:
1. Since you only hit the wall after hitlag has ended, the timing for pressing L is harder. If the move's hitlag is x frames, then you would have 20-x frames to press L. For some moves, this makes it nearly impossible to tech.
2. ASDI happens at the same time that you starting flying away out of knockback. This means that on the first frame after hitlag has ended, your movement is the combined effect of knockback and ASDI. If the hit is strong enough, your net movement on the first frame will be away from the edge. Therefore, it is impossible to tech using ASDI at arbitrary percents.
3. You have to hugging the wall when you get hit, otherwise you won't be able to go far enough with ASDI to tech.
Because SDI allows you to tech during hitlag, it avoids all of these problems. The only disadvantage is that it is slightly harder to do.
What you should generally do to tech is this:
1. Up B and hug the wall. If you're in a position where this is impossible, just make sure you're as close
2. Press L just before you get hit. The closer the better, but anything between 5-15 frames works well.
3. As you get hit, do a upwards quarter circle towards the stage. So, if you're teching on the left edge, your control stick should start off on bottom right, and end up on the top right. Doing a quarter circle has three advantages over just smashing the stick towards the edge. First, it makes it easier to time, because as long as the moves hitlag overlaps with your quarter circle, you will get at least one SDI off. Second, It allows more than one SDI, so you can tech even if you're a little bit away from the wall. Third, if you miss the tech, your control stick will be positioned to input the proper survival DI for most moves.
4. hold up to walljump.
5. After you tech, you should either side b instantly to grab the edge, or wait and side b into your opponent in their lag, depending on what move they did. Against something like peach's downsmash, wait to side b, or you might tech one hit then get hit again right away. Against something like Falco's dair, side b immediately, or he will be able to hit you with a different move. If your opponent is at a high percent, and right next the edge, you can also bair after your walljump, and hit your opponent away from the edge. I wouldn't usually recommend the last option though.