#1 and #2: The content is added to the the end of the email. The subject, if passed, will override the existing subject if there is one. If not passed, the subject will remain untouched.
#3. Yes onInteractionEndedEvent will fire after the interaction has ended, so too late for what they've descried.
I'm assuming you want to append some text to the end of an email as it's sent, and send some final message in a chat window when the interaction is ended?
For email, you could perhaps use the Insert Signature feature on the Email Widget (would require the agent to hit the link), or use insertContentIntoEmailBody on email creation, with some whitespace up top, and the agent could include their response above this.
For the chat case, I'm not sure if we support what you're describing, but you could perhaps include the links in the Suggested Phrases widget and have agents send those
#4. There's no simulator, you will need a lab up and running to do any meaningful work with the Widget API.