LE executes /storage/.config/autostart.sh at the start of userspace boot long before the network is brought up. As a result the script logic will always return "Internet is not available. Exiting without download." making the script (as-is) pointless.
The low-skill approach to scheduling the script to run later in the boot sequence is to "(background)&" execution and use a sleep command (10s is normally enough). This will ensure the script works, but Kodi will have already started so there's no point trying to redirect messages to the console TTY for on-screen display alongside the LE boot splash which is quickly overwritten with the Kodi boot splash then home screen; although often that happens quickly so you only see the home screen.
The better approach is to schedule script execution with a systemd service as this supports dependencies; you can dependen on network-online.target to ensure the network is up and avoid the ping-Google check. If you further depend on kodi.target you can also use kodi-send to show a toaster notification in the Kodi GUI, e.g. "Image Downloading.." and then "Rebooting in 5 seconds" or such before you force reboot to update. Have a look at the example wireguard.service in /storage/.config/system.d/ for something similar to what you need. Beware that systemd does not inherit $PATH so you must use /full/path/to/binary in commands.