Ok so I don't know what log out during mid walking means lol.
This doesn't toggle run, it just checks to see if run is toggled, and if so drop in a loop for as long as run is toggled, once run energy is out it then calls itself aka P4th();, which thens switch's to a walking loop, it was the best I could come up with.
I'll get a video of what it does soon, I ended up having to reinstall everything lol.
I was using proton mail for my account I think I can still get into it not for sure lol.