thanks for the replies, guys. In my case, i was thinking of using this for populating an archviz model of a hotel, where each room would have a similar furniture arrangement, made up of instance objects for bed, chair, couch, lamp, etc. Then I would like to create some randomness in exact types of lamps, for example - so that is where my interest in some script function comes int play. I was imagining that I would select all "lamp" instances, and randomly have assigned one of several lamp geometries. In my current case, i have a few hundred different rooms, so it's not feasible to do this manually.
another example I was considering would be to have a landscaped garden made out of instances, arranged in a specific configuration (e.g. not a regular cloner grid), then I would be able to randomly vary the referenced object for each of the clones, rather than manually re-assgning the referenced object.
I will check out the example file - thanks! the tip about de-activating xpresso might do the trick as well 🙂