Having issues with wait statements

Thank you so much dave_59 and cgales. Both the solutions work.

But I am still a little bit curious about the wait statement.

“The signals don’t necessarily have to change for the wait statement to evaluate as true.” - Why is this the case? Shouldn’t both the signals need to be HIGH for this wait statement to evaluate as true and unblock the rest of the code that follows?

How is the wait statement in general different from a while statement?