Read GPIO state ,use it to change icon (switch)

Maybe using the gpio binding is easier?
https://docs.openhab.org/addons/bindings/gpio1/readme.html

Or as i read Skript i think an other solution is using the exec binding and transformation. Maybe you might find some helpfull infos in the following tutorials.