I'm sorry but there are no bugs in the script. It works as it supposed to be.
2) You don't need to 'wait' for the block, if the flood protection is triggered the contact is blocked immediatly (if a block time has been set).
3) in future try to post immediatly what didn't worked and what you exactly did. People aren't mind readers ....