Note that the On Drag event object has a hypeGesturePhase field:
When receiving a callback for the "On Drag" event with the "Run JavaScript…" action the event object also offers information about whether the current drag gesture has just started or ended, was canceled, or the coordinates were updated. To get that state, access the hypeGesturePhase property in the event object: hypeDocument.kHypeGesturePhaseStart hypeDocument.kHypeGesturePhaseMove hypeDocument.kHypeGesturePhaseEnd hypeDocument.kHypeGesturePhaseCancel
So I'd probably do something like change the drag() function to combine with the grab() and use this as a condition to determine which to show: