Okay, so I'm not sure it's the most optimal way of making timed things in scripting, but the way I usually make things is quite simple
You need to make a new variable in the initialize function named for example
frames and then just have this code in your update function
if frames == 20 # Or any other value you want
# Do things
frames = 0 # Reset the frame count since the action is already done.
else
frames += 1 # Add one to the framecount.
end
A very simple script that counts up one each time it's is run and when it's at the framecount set, it will do what it should and then reset the variable so it can run again.
It would be preferred to have it in another
if that checks if the thing you need timed is actually showing so that it don't always count up and when the timed thing shows, it's at 19 or something, so it will only show in one frame.
Like I said, there is probably better solutions, but this is one of them.