For Thunderbird there is the External Editor extension a very very classical piece of software that, when called via a shortcut, pops up your external editor (emacs in my case) and let's you edit your mail there. While editing the compose window of Thunderbird is blocked. When the external editor closes, the compose window is populated with the updated text of the mail. Very convenient to have your mail as one buffer in your emacs, for instance to edit tables, copy computational results, use power editing features like regexp-search-and-replace, etc.
My question: Is it possible to implement the same thing using Mac OS Mail + AppleScript or other tricks?