@Habibie, as Poida said, script is just for powering OFF LG TV. It has no influence to power on sequence.
For power ON LG TV via TV BOX, this does not work now for me in CoreELEC but it does work with Android stock 7.1.1 firmware KIII PRO. So I am expecting either wrong config of CEC driver for LibreELEC / CoreELEC or wrong system setup on my side (I was not able to power on the TV even by using cec client commands). I am planning to make a test to go back to Android image again and re-run clean CoreELEC and LibreELEC from SD card in order to verify if it works or not.
I did mention the issue in the forum but no feedback so far. https://discourse.coreelec.org/t/lg-tv-power-on-issue-via-hdmi-cec/1034