Hi,
when the first person types !trigger,
%wait is set to 5, so that the bot won't message another line from the text file within the 5 seconds. This is assured, because the code to relay this line, only triggers if !%wait { }
%talk is set to 5, so that the bot won't message "Please wait x seconds..." more than once, within 5 seconds. This is assured, because this message is only posted when %talk exists. After posting the message, %talk is unset, thus this message won't occur anymore.
In conclusion,
%wait is there so that the script doesn't flood with a line from the text file.
%talk is there so that the script doesn't flood with the message "Please wait x seconds.."
Greets