A Keyboard Maestro custom plugin:
and a sample macro making use of it:
which uses Jesse's excellent Birch-Outline library to send selected Mail to the top or bottom of a specified project in a TaskPaper 3 file at a given filepath.
TaskPaper 3 does not have to be running at the time, and is not launched by the macro.
I originally put this together for Jim Krenz, who provided the specifications and the icon. Jim has kindly suggested that I share it more widely.