I usually store the job ID in a variable upon submitting the job, then I check the exit status of qstat in a loop:
while qstat $jobid > /dev/null 2>&1
echo "job $jobid done"
The first sleep 5
command takes care of any latency (delay) in job submission. Then I force the system to sleep and re-check the job status every 60 seconds. Hope this helps.