"Delete Doubles" issue

“Delete Doubles
This function removes double notes, i.e. notes of the same
pitch on the exact same position from the selected MIDI
parts. Double notes can occur when recording in Cycle
mode, after Quantizing, etc.”

This only seems to work when the doubled notes are identical (in length, for example), which they usually aren’t.
Is there a way to edit this function or set up a logical preset that will simply delete the shorter of two doubled notes?

Cakewalk has a CAL program called “UNDOUBLE” that does this.

Thanks for any and all help…