URGENT: Selecting instanced objects via a script

Hi,
I have a shedload of nodes, lots of them are nested too, and I having to fix a scale problem..
for speed sake;
I need to be able to select ALL and ANY nodes that are instances (and instances only) and then use the "instance split" MEL on them...
then freeze the transforms.

what way could I search the entire hierachy and select only the nodes that are instances via a MEL script?????

I am in the process of learning MEL , but this is currently beyond my MEL skills..

Anybody? Please?
I really don't want to spend hours trawling thru my hierachy..

thanks in advance...

PS: if anyone tells me to go learn MEL I'll scream! lol
I AM learning it... just slowly as I have work to do

$transforms = ls -typ transform;
string $instances[];
clear $instances;

for ($transform in $transforms)
{
$shape = listRelatives -s $transform;
$parent = listRelatives -p $shape;

if($parent[0] != $transform && size($shape) == 1)
{
$instances[size($instances)]=$transform;
}

}

select -r $instances;

This may not work for instanced groups of transforms.