Create a loop and write something like yield(get_tree().create_timer(0.5), "timeout")
at the end. This way, the script will pause for 0.5 seconds (or any time you want) and will proceed when the time is over. You could probably also use yield(get_tree(), "idle_frame")
or yield(get_tree(), "physics_frame")
. This will pause your script till the next "process" or "physics_process" step will accur.