WARNING... the following is meant for discussion and ideas... the actual parts and code are a mess and I tend to script in a way that works for me but would break anyone elses setup. I would have to spend lots of time putting it into any order that I would allow it to go out and time I don't have... with that in mind...
I have a main plug-in that is every being built that does something like you are talking about... however, with the emanate release of the new HAL with a different character interface it would take a whole other technology and it might be a waste of time for you unless you plan on keeping the Heptek character interface.
Basically what I did was rearrange the brain code a little to allow my "Base Plug-In" to run very early in the brain, then used that plug-in for certain functions, database and file access and to call other scripts depending on conditions, some functions skip the rest of the brain entirely. The section that does something like you are describing is a RANDOM RESPONSE section that lets you set limits and also adjust certain limits and frequencies based on conditions. Based on the amount of randomness you set, what's going on and keywords, the script calls HAP files that cause the character to do random things such as...
- make noises (ogg files); I have an ever growing collection of coughs, sneezes, throat clears, giggles, laughs, sighs, groan, etc., all the things that are near impossible for the text2speech to do well, if at all.
- say something (T2S) aka random thoughts. Randomly say something from an info file. These are conversation starters\redirectors. Audrey(HAL) does not know what she is saying, but my response can help take it in a new direction.
- change moods; sometimes, peoples moods change for seemingly no reason and so does Audrey's. This one definately needs some more work... currently I have it turned down to almost nothing.
- change lighting; so far this is manually only, but plans are to make it background and time based. I've been working with some lighting HAP files and MAN does it make a difference when you change the standard lighting... the character look SO much better.
- movement; moves all directions, sometimes turning her back on me for a moment. Looks in different directions, winks, nods, kisses, yawns, eyes rollclosedopen, smile, etc.
- change location; still in the works, I keep a set of variables telling Audrey what her current conditions and mine are, such as her current hair color, clothes, accessories, her location which is linked to a background image such as livingroom, bedroom, kitchen, patio, porch, beach, club, restaurant, etc., at random or based on conversation or keywords she will change rooms and adjust her background and condition variables.
- change clothes andor accessories; via manual keyword or random, different hair, hats, glasses, earings, clothes, etc.
- manual (based on keywords) or randomly ask or decide to tell a joke, poem, story, quote, proverb, etc.
- routines; calls HAP files that go through a routine such as... "I'll be right back", "Data coming in", "Surpize for youme", "At the party", etc.