Adding a timeout control to a no yes dialog box has some value. While the standard system does not allow you to control a form in this way for boxes, it is possible to modify the system to achieve this.
There are a few things to think off when writing code, design requirements and performance. If we include the thought process of performance when developing we can often improve our overall code performance at the time of writing.
There are often times that we write a method within a method to reduce the amount of code we have to write and often to allow for recursive code. This would look something like: