NetworkManager - if-down.d script does not execute

Try to move your "disconnect" script to /etc/network/if-post-down.d, that's the directory that should actually get run when NetworkManager disconnects, rather than if-down.d (which would mean triggering something as the device goes down, not when it just disconnected). For what you're trying to achieve, it shouldn't be an issue, and in fact avoid trying to send the SMS via network while the default gateway might not yet have been updated.

This obviously assumes you then still have another connection (wired) to send the SMS over. Anything else is too uncertain and unreliable to be worth using (you can't expect the wireless connection to be working enough by the time the scripts are run to send an SMS over it).

If you want to investigate further into this, you can look at /etc/NetworkManager/dispatcher.d/01ifupdown.