The script in question listens for a link_message with a UUID, and also listens for the commands "lock" or "unlock". On hearing the UUID, it sets global variable TARGET to that value. On hearing "lock" or"unlock", it enters states "on" or "off" respectively.
On state starts the particles flowing on entry. Off state clears the particles.
Or, at least, it SHOULD do. In fact, what it does is just sit there grinning at me for three days. I've discovered that if I put a linked message listen event in the "on" state and wait for the TARGET key there, the particles flow just fine. But only for five seconds.
Now, this says to me that TARGET isn't updating or being read properly.
Here's the full script; I hope someone can spot an obvious mistake I'm making

CODE
key TARGET;
default
{
link_message(integer sender_num, integer num, string str, key id)
{
if (num==5) TARGET=(key)str;
if (num==1)
{
if (str=="lock") state on ;
if (str=="unlock") state off ;
}
}
}
state on {
state_entry()
{
integer flags;
flags | PSYS_PART_FOLLOW_VELOCITY_MASK;
if (TARGET != "") flags = flags | PSYS_PART_TARGET_POS_MASK;
llParticleSystem([ PSYS_PART_MAX_AGE,3.0,
PSYS_PART_FLAGS,flags,
PSYS_PART_START_COLOR, <1,1,1>,
PSYS_PART_END_COLOR, <1,1,1>,
PSYS_PART_START_SCALE,<.075,.075,.075>,
PSYS_PART_END_SCALE,<.075,.075,.075>,
PSYS_SRC_PATTERN, PSYS_SRC_PATTERN_ANGLE,
PSYS_SRC_BURST_RATE,.05,
PSYS_SRC_ACCEL, <0,0,0>,
PSYS_SRC_BURST_PART_COUNT,25,
PSYS_SRC_BURST_RADIUS,0.0,
PSYS_SRC_BURST_SPEED_MIN,0.0,
PSYS_SRC_BURST_SPEED_MAX,0.0,
PSYS_SRC_TARGET_KEY,TARGET,
PSYS_SRC_INNERANGLE,1.55,
PSYS_SRC_OUTERANGLE,1.55,
PSYS_SRC_OMEGA, <0,0,10>,
PSYS_SRC_MAX_AGE, 10.0,
PSYS_SRC_TEXTURE, "chain",
PSYS_PART_START_ALPHA, 1.0,
PSYS_PART_END_ALPHA, 1.0 ]);
}
}
state off {
state_entry(){llParticleSystem([]);}
}
, so you won't ever get any more link messages.