What you're looking for is setInterval and there is a nice sticky post about it at the top of this forum.
The method you're currently describing of waiting for a few seconds won't work, because actionscript scripts are supposed to execute very quickly between drawing frames.
So instead, the way it's done is you use setInterval, and you say "execute these lines of code XXX seconds in the future".
code:
myFutureFunction = function()
{
// setInterval will repeat every XX seconds if we don't clear it here...
clearInterval(handle);
// future lines of code go here...
}
// execute some code here...
// Then use setInterval to schedule myFutureFunction 4 seconds in the future
handle = setInterval(myFutureFunction, 4*1000);