Probably the best way to get answers to those questions is to ask them of the email service. Of course, then you're on some salesperson's 'hit list'.
The O.P. is absolutely a "rebuild the wheel" thing. There are several competing companies (we use iContact; others include aWeber, MailChimp, ConstantContact, &c, &c).
An image beacon is fairly standard for detecting opens. It's not a terribly reliable statistic, though, as most MUA's block images by default now until the user allows it (or marks something like "always open images from this sender"). So someone might read your email and not open the photos. Your "opens" number will be lower than reality as a result.
It's mostly impossible to tell when an email gets forwarded by the MUA. Some ESP's include a link in the message, e.g. "Forward to a Friend", which opens a browser window to their site with the email content shown and an address field. That they can track. Now, it's possible to make a guess about forwards, by tracking the IP and a cookie and making a deduction: see this page (Cathoo's answer) about 1/2 way down.
The only way to track an "open" in a plaintext email is to record an "open" along with any link click from that user/email. So that number will be artificially low if people read the mail with a plaintext MUA but don't actually follow any links. I don't know of many stats about how many users are still using plaintext-only MUA's though. Almost every client is HTML capable by default, although I don't know as much about mobile, which is being used by a continually larger group of people ....
That being said, my personal email still gets read with Mutt. In this regard am I not typical.
* code to track how many outgoing emails are sent as html and text.
Both should be sent, and the MUA should decide which to show. You should, if possible, allow the user to set a preference (text vs. HTML), but most won't. If one does, it will usually only be the people like me.
As for automating your message creation and sending, that's kind of a Holy Grail at our shop. I've not found time to do it.