Oh I just thought of a real simple way to fix it. If "finish" text appears, then disable Q Key. I don't know a whole lot about programming (still a student) but that should solve the issue.
Figured since you're studying programming that seeing the solution I did might be interesting.
Here's a snippet from that code (C#)
Basically, I just have a bool set to true if the player has finished.
If they have, I just don't Allow the player to reset.
Your solution was a good idea, this does basically the same thing.
But instead of disabling the button I disable a part of the function.
if (hasFinished == true)
//Reset the timer
if (Input.GetButtonDown("P1_ResetToStart") || Input.GetKeyDown(KeyCode.Q))
currentTime = 0f;