Yeah, it could be fine in a lot of cases. Just depends on what you want and what you're working on. Here's the (much simpler) code for doing it while still processing the single b presses.
player script
on cancel do
if framesSinceBPress<5 then
say "good job, you double clicked 'B'"
end
framesSinceBPress = 0
end
game script
on loop do
framesSinceBPress++
end
You'll run into problems if your single b press does anything like triggering a say or opening up a different menu, but if you're just swinging a sword, this code might be just fine. Otherwise you'll wanna use the code in the original post.