When I run the script if the card is not already disabled it does not disable it even when I disconnect the ethernet cord and replug it back in.
Edit: The script seems to check if the WiFi card has an IP address first before going to the disable WLAN function.