Rather than just testing the velocity, I think you should also require a minimum amount of travel before dismissing.  Maybe make sure that dy is > than 50% of the keyboard height?  Also, if you're testing the absolute value of dy, then I think you can avoid the expensive trigonometry and just ensure that dy > 0 and dy > dx to make sure that it is a swipe down.