Changing it to an inline wait (the <wait> at the end of the line) seems to make it behave properly, but if it doesn't, you can take out the wait entirely and just press the button twice.