What happens when an SDcard is inserted? I have a rooted Sony Tablet S, and one of my issues with it is that there is little onboard storage. The Sony-recommended way of dealing with this is to transfer files between internal and external storage, as many apps do not have access to the external storage.

Having rooted the device, however, I am able to use mount -o bind /mnt/sdcard2 /mnt/sdcard/2 to mount this. I was then intending to rename the media folder on my external sdcard to .media, and use mount -o bind /mnt/sdcard2/.media/$F /mnt/sdcard/media/$F/external for each folder $F in that directory. The problem with this is that on removal of the external sdcard, or on reboot, these mounts are lost. 

On my Maemo phone I did something similar, and was able to have this mount behaviour occur when the external storage was attached. As Maemo5 is a truly open OS I was able to do this fairly easily, and there was a lot of community support. 

When trying to do the same under Android I have come across an app called Tasker that performs actions as I would need, however this is paid software and I would prefer not to have to install something that performs actions which should be build into the operating system.

TLDR;

I'd like to know what is actually happening on my device when an SDcard is inserted - are scripts run? Are signals sent which could be used to trigger scripts? Has anyone attempted to do similar (I don't understand why this would not be the default behaviour to be honest - the fact that external storage is hidden from apps is frustrating to say the least)
If your intention is to have your script run each time the card is inserted, or the device is booted, I'd recommend the already mentioned app Tasker, maybe in connection with Scripter. The latter can be used to execute (and manage?) scripts, but AFAIR you can do that part with tasker as well.

You would need to create 1 task (execute your script), and 2 profiles using this task (as there is no possibility for a logical OR with the conditions). One is for the boot_completed event, the other is for the inserted SD-card. That should do it.

In case of trouble (or hard understanding), just comment and I see what I can do :)