You have to be careful when using waits in functions because they continue to run and depending on how you structured it you could be running events at the bottom first. Adding the wait to the top doesn't mean it will wait to run the rest of the function if there are multiple conditions.
As described you could use the Timer behaviour for the display thing. Start a timer and then make use of 'on timer complete', then no need to use a function or waits.