I believe you would be able to use the project https://launchpad.net/magick-rotation
though I do not have a Dell Inspiron Duo rather I am using a HP EliteBook 2760p and have successfully used that project to run shell scripts from which point one could script what ever they wanted including calls to existing programs.
As for the touch interface, "Ubuntu Touch" is mostly for phones but you have a tablet pc...unsure the complexity of switching between the "Unity" and the "Touch" interface...
Though to the point of scripting the screen rotation you can find the following example here
#!/bin/bash
old="0"
while true; do
if [[ -e /sys/devices/platform/hp-wmi/tablet ]]; then
new=`cat /sys/devices/platform/hp-wmi/tablet`
if [[ $new != $old ]]; then
if [[ $new == "0" ]]; then
echo "Rotate to landscape, hide CellWriter."
xrandr -o normal
xsetwacom set stylus rotate none
xsetwacom set eraser rotate none
xsetwacom set touch rotate none
cellwriter --hide-window
elif [[ $new == "1" ]]; then
echo "Rotate to portrait, show CellWriter."
xrandr -o right
xsetwacom set stylus rotate cw
xsetwacom set eraser rotate cw
xsetwacom set touch rotate cw
cellwriter --show-window
fi
fi
old=$new
sleep 1s
fi
done
# From Red_Lion post #576: http://ubuntuforums.org/showthread.php?t=845911&p=7732316
There is a poject called desktop-switcher which has an non maintained "sourced code base" which might be helpful if you want to do more than scripting as suggested above...