I would think your first choice easier to understand and error-check.
I personally like the first approach since between those two lines you can insert
>echo $UL_PROCESS
This get to preference, skill level, speed necessary (if churning thru lots of records) and ability for others to understand your code in the future. Thus, I normally choose the path where I set a variable in one line, then check it next.
Perhaps logic like the following, and I know the syntax is all bad!
while $UL -eq 0
do
if filetype=temp
then
do your hostname thing
exit
fi
sleep
date # show that something is happening and looping, delete later
done
#at this point $UL -ne 0 & not temp filetype
#so the rest of your logic