I read the guide again. It is working fine now. I may need to tune it more in the future, and I think the guide is enough for that. Maybe I could change the time it takes to stop. It happens a bit faster than I imagined, but it is good enough for now.
Now, I have 2 problems left:
1- Starting Node-Red at boot, and deploying the project at full screen. Goal here is to give user only the project screen on a touchscreen, blocking the user from doing anything beyond touching the on/off button on the screen, after plugging the system up.
2- Without doing any changes, I sometimes get "Connection Lost" errors. Sometimes too frequently, sometimes once in a few hours. I think this is because of the wiring. I was using a breadboard, but I'm going to solder it, and then see what happens. Another thing that may cause this (I think), is maybe computational limitations. Maybe this is the reason I sometimes get the error after it running for a few hours. Never had a problem like this one, so I am not sure. Lastly, maybe the NOOBS OS can be the problem. I have a Raspberry Pi 4 B+ with 2GB RAM. A friend of mine told me that he even used it as a personal computer for 3 months without having a single issue like freezing. Mine keeps freezing at simple tasks like opening a new tab, or clicking somewhere before typing. Sometimes, I even see letters coming up 3-4 seconds later while I am typing something. My friend said that this never happened to him. Also, I checked updates at day 1, and there were no updates that I needed to download.
I know, they are not related to my original title, but I wanted to ask your opinions on these 2 subjects above.
Thanks a lot for the guidance and detailed explanations!