Hi,
I would use Get Device Acceleration, because it shows the gravity, which means with some vector math, you can deduce the angle of the Device. however this is really challenging for my poor brain... I never was able to get it right...
I haven't found myself a good examples that works for all device orientation, if you find a regular script or example somewhere that works for you, I'll happily make it as an action.
Bye,
Jean