autostart.sh is run at the start of userspace boot and the script will execute fully before boot continues; i.e. if you don't want to block boot you will need to (background)& tasks in the script. NB: If you background things there is no guarantee your tasks have finished before Kodi starts. It provides lots of possibilities for fixing and breaking things