The code in #30 will ignore button pressed shorter than shortPressMin. I would prefer to get a short press message no matter how short the button press, but that is a matter of opinion.
Otherwise it works and seems to do what it means too. The code in #9 reports both press types on button release. Having played with this for some time leads me to the conclusion that a long press should be reported, as the code in #30 does, as soon as longPressMin has elapsed, regardless of the button being still down. This makes a bit of complication to the code, and is also something that might depend on the circumstances.
The code in #9 could have a reporting value added that would come once amidst the "still down" reports, so everyone could eat the kind of cake they like with the one object.
TBH I've always hated user interface elements that depend on time, like short versus long presses or even double-clicking, the timing of which is at least something that can be adjusted by the user.
The one place where I don't mind a long press is the very longish press that is sometimes used to turn something off or reset a mechanism. In those cases, the action should occur when the long press time has passed.
a7