Ok, this works the way i want it to, it refreshes every 5 seconds (i hope) but my problem is when i click home, the loop seems to restart and "ON" reverts to "OFF"
I can't quite see what you're trying to achieve here, from the naming it looks like you want to check for a key while insert is not pressed every 100 or so ms, then halt for half a second randomly and then clear the screen.
It could be put so much more simply, in doing so, it'll likely fix the logic. It's a very strange code sample semantically.