Hi grhhm!
I don't know your complete setup, but I think you're on the right track.
To call a TV RC power button script, you could wite something like that at /storage/.kodi/userdata/keymaps/remote.xml:
Code
<keymap>
<global>
<remote>
<power>RunScript(/full/path/to/your/python/script)</power>
</remote>
</global>
</keymap>
Test this mapping by scripting a simple task, like creating a file.
If your TV backlight RC power button acts the same way like the TV RC power button, then you probably don't need a variable for the on/off status. Acting the same way means, both devices only have one RC button for turning on and off.
Maybe the LIRC solution of Hias is better, but it's good to have extra options.