Did you try to execute the script as user openhab from the commandline?
Does the user Openhab have all necessary rights to acces I2C or GPIO what ever your skript tries to access?
In the following post all this things are explained in detail. It usees the Exec binding but all this is also relevent for executeCommandLine.