With no skills at all, I just managed to implement MacSparky's script for getting the URL of a message in Apple Mail (see https://www.macsparky.com/blog/2019/02/applescript-to-link-to-apple-mail-message/)
But I failed at getting only the subject of a specific email in order to create a nice looking markdown link. Maybe you could have a look at this and share your results?
It would also be great if you could look into getting the URL of a specific project in the task manager Things 3 (see https://culturedcode.com/things/support/articles/2803573/)