Constructions of the type while(1) do ... end are loops. If there is no command to exit the loop within them, it becomes an infinite loop. When you call haste_p1(), the script runs inside this function infinitely. For such things, you need to use separate threads, using the function startThread(function name). Launch it once, you can do it right at the start of the map, and it will run forever.
Thank you, now everything works as it should.