1st, you need a rooted android device. 2nd, use Runtime.getRuntime().exec() to invoke the script as root user. the script may like:
mount -o remount,rw ... #depends on your system partition block device
cat "pm.sleep_mode=1" >> /system/build.prop
setprop pm.sleep_mode 1