Basically all that you are doing is shortening the window in which you can be shield grabbed.
The factors you have to take into consideration are as follows:
When the last hit of your move hits your opponents shield
How strong that hit was
How fast you are going to hit the ground after performing the hit
How long it takes you to recover from the lag of the hit
And how long it is going to take them to perform the grab
For example:
You are fox, your opponent is, let's say, marth:
You run at Marth, use your Nair, this is what happens:
Your nair hits marth's shield
Marth is stuck in his shield for however many frames due to shield hit stun,
Once it runs out, marth can initiate the grab, and 7 frames later it will grab you, if you are near
You are stuck in the air, and in your nair, for however many frames
Once you hit the ground, assuming you L canceled, you have 7 frames of landing lag
So basically, if the time it takes marth to recover from shield hit stun, initiate the grab, and grab you is less than the time it takes for you to land from the move, L cancel it, and dodge/roll/shine, he grabs you.