Applescript: Detect if Mouse or Trackpad attached
Okay, first I misread your question so I've rewritten my answer and second because the "Scroll direction: natural" preference setting is global, I've rewritten the code as well.

As coded there are two subroutines, one each for the mouse and the trackpad (internal or external) that's called based on the existence of the defined devices. That's defined as in the value for mouse, externalTrackpad and internalTrackpad as returned from the do shell script commands configured to look for Apple Magic Mouse, Apple Wireless Trackpad and an Internal Trackpad. Theses commands can be changed as needed/wanted.

Basically what happens is the variables are initialized and then tested by the if statements and acted upon accordingly as coded. 


If a mouse and external trackpad doesn't exist and an internal trackpad doesn't exist then a message is displayed and the script terminates.
If a mouse and external trackpad doesn't exist and an internal trackpad does exist, then the TrackpadIsAttached subroutine runs, the "Scroll direction: natural" checkbox is unchecked (if checked) and then the script terminates as the setting is global and there is no need to process further.
If either a mouse or trackpad (internal or external) exists then either subroutine runs as appropriately coded, the "Scroll direction: natural" checkbox is unchecked (if checked) and then the script terminates as the setting is global and there is no need to process further.


on MouseIsAttached()
    tell application "System Preferences"
        activate
        set current pane to pane "com.apple.preference.mouse"
    end tell
    tell application "System Events" to tell process "System Preferences"
        tell radio button 1 of tab group 1 of window 1 to if value is 0 then click
        tell checkbox 1 of tab group 1 of window 1 to if value is 1 then click
    end tell
    tell application "System Preferences" to quit
end MouseIsAttached

on TrackpadIsAttached()
    tell application "System Preferences"
        activate
        set current pane to pane "com.apple.preference.trackpad"
    end tell
    tell application "System Events" to tell application process "System Preferences"
        tell radio button 2 of tab group 1 of window 1 to if value is 0 then click
        tell checkbox 1 of tab group 1 of window 1 to if value is 1 then click
    end tell
    tell application "System Preferences" to quit
end TrackpadIsAttached

tell current application
    set mouse to (do shell script "system_profiler SPBluetoothDataType | awk '{ FS = \": \" } ; /Apple Magic Mouse/ { print $2 }'")
    set externalTrackpad to (do shell script "system_profiler SPBluetoothDataType | awk '{ FS = \": \" } ; /Apple Wireless Trackpad/ { print $2 }'")
    set internalTrackpad to (do shell script "system_profiler SPUSBDataType | awk '/Trackpad:/ { print \"Internal Trackpad\" }'")

    if mouse is equal to "" and externalTrackpad is equal to "" then
        if internalTrackpad is equal to "Internal Trackpad" then
            my TrackpadIsAttached()
            return
        else
            display dialog "The Mouse and Trackpad are not connected." buttons {"OK"} default button 1
            return
        end if
    end if

    if mouse is equal to "Apple Magic Mouse" then
        my MouseIsAttached()
        return
    end if

    if externalTrackpad is equal to "Apple Wireless Trackpad" then
        my TrackpadIsAttached()
        return
    end if
end tell




Obviously I used my Apple Magic Mouse and Apple Wireless Trackpad as examples and tested against to ensure it worked as coded on my MacBook Pro. You can use whatever manufacture, make, model for an external mouse and trackpad and you'll just need to edit the script appropriately. If you need additional help with that just ask. Also I tested this under OS X 10.8.5 and it worked for me as written.