The first problem is detecting whether the device is an iPad or iPhone. I believe the only way to do this is by checking the device resolution (of course, you can distribute separate binaries for the different devices, but you mentioned doing this in one app).
Usually you can handle screen rotation in the XML app descriptor, e.g.:
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
However, since you want to do different actions depending on the device, this won't work.
An alternative that I have used in the past is to detect Orientation events and prevent the default and manually set the orientation through AS3. Here is a good example of how to do this: AS3 - iOS force landscape mode only?
Using the code sample presented there, it's just a matter of taking your device detection / screen resolution detection code and setting the screen orientation to the appropriate detection for that device (and preventing the appropriate orientation events for that device).