Control the backlight of a touchscreen with one touch

Hello everyone,
I have a 10" touch display connected to my Khadas Vim1s via HDMI. I can control the backlight of the touch display with a Mosfet using 2 soldered cables. I want the backlight to be switched on when I tap on the display and to be switched off after a short period of inactivity .
Unfortunately, I don’t know much about script programming, how can I do something like that?