Simply make a variable that is $true if you are waiting for the key to be pressed.
Then when the key is pressed, if variable exists, do what youw ant.
alias key_ {
set %key_ $true
echo -a Ok Im waiting for you to press the key.
}
alias f5 {
if (%key_) {
echo -a I waited for the key to be pressed and you just pressed it.
unset %key_
}
}
Type /key_ to start this. Press F5 after.