How to automate changing the settings when you connect the mouse?
You can use Keyboard Maestro:



Repeat script with 'is disconnected'.
You may need to change the USB device name.
AppleScript from shell script: Toggle Natural scrolling from command line with reload