Better solution for a delay in a script

Please view this recent thread for suggested approaches: Alternative to sleep