You could use schedules to delay functions.
schedule(time in milliseconds, obj(usually 0), function name, arg1, arg2, arg3, ...);
just one thing:
echo(1);
schedule(1000, 0, echo, "2");
echo(3);
This will echo 1, then 3, then wait one second and echo 2 like this:
1
3
2
Or you could do this:
schedule(2000, 0, eval, "
dosomestuff(\"make sure to use backslashes for quotes inside here\");
dosomeotherstuff(32);
echo(\"asdf\");
");