Running sh script non rooted
For executing scripts there are two possibilities:
Via Android Debug Bridge (adb)
ADB is usually used when the device is connected via USB to a PC. But for trusted Wifis there is a also a possibility to run ADB over Wifi (but the connection is play-text like terinal which may lead to security problems, therefore the limitation to trused Wifis). Then you can execute a script that is e.g. saved in /data/local
Use an app like Termux
Apps like Termux provide an environment similar to a Linux distribution with packet manager and execution environment. You don't need a connected PC. However as Termux is an app the Android permission system applies you may get a problem accessing the Bluetooth hardware as Termux as far as I remember does not requests the Bluetooth permissions on installation.