The problem is that you are entering the do...while when clicking object, but you are not leaving it at all, because you are not giving the possibility to change the number and click another time. In other words, what you have is evaluating only the very first number you input and then remains in the loop forever.
I am not sure if it is a must, that you are using a form and clicks but...
As example I am going to give you the pseudocode of a console application
main
do
print "give me a number, to end the game type [exit]"
get the input
if (bigger)
print "number is bigger"
else if (smaller)
print "number is smaller"
else
print "that is the number"
while ((input not equal to number) or (input not equal to "exit")
end
do you see the difference? once you get into the loop you have to give a chance to correct that number or get out of the loop.
In your example, a possibility (not elegant but feasible) would be to use non-modal messagebox, so the user can type another number and then click ok.