First a question, are you looking for a workflow or program that is already written then will do these things or are you looking for help in writing them yourself?
It is unlikely that there is anything out there this specific so unless you are looking for help to write something I don't think you will have much luck.
Assuming you are asking how to write these things first realize there is no automatic way to get Aperture to start running a program except for one time and that is during import. So 1 is possible as a import action script.
2 seems lees likely as there is no way that I can think of to have an automator or Applescript be aware of when an image is edited and if that images original is a Raw file as opposed to a JPG
So to put it another way what you are looking to do to is partially possible but will not be simple. It might be best if you described your workflow and what it is you are trying to accomplish here. There may be a better way to achieve it.
Sorry for getting back to this a month later... but here's my issue (my sense is that I might need applescript to do this which I have never done before).
I shot in RAW and after shooting import the images into Aperture. (I keep my RAW originals on an external drive which is backed up locally and remotely).
I would like to have a "portable" copy of my image library in jpeg format for a variety of reasons:
1. Usually after importing and sometimes after editing pictures if I remember I'll export high res jpegs to a network drive (this gives my wife access to the files so she can play with them as well).
2. I'd like to bring my image library with me in jpeg so I can share the photos with others if needed.
I could auto mirror the raw library but raw files aren't as portable.
The email example is not the best.
Here's a better example:
I take a bunch of pictures of my kids and put them on aperture on my computer. When I import I manually have aperture export the versions as jpegs to our NAS.( Basically my NAS has exported jpegs of all my RAW pictures.) Later I go back and make some edits in aperture or flyout to photoshop or whatever. I forget to "re-export" my altered versions. I leave the house. Wife calls me and says, I really want to print/facebook/email/etc that picture you took. She can't get to those pictures because I forgot to export.
In an ideal world what I would want aperture to do is whenever I import new pictures it says, "hey you just added new pics, lets upload those to the NAS". Also, whenever I make changes to pics it says, "hey you just changed these 10 pictures, should we export those versions to the NAS". What this does is keep a jpeg library that is equal to the current state of my Aperture RAW library with edits. I can take the library with me on a portable drive and access it on any computer (mac or PC). I can plug it into my phone with USB OTG, etc, etc, Basically, I'm not tied down to Aperture anytime I want to do anything with my photos.