Using MEL expressions to control particles, followed by joint rotation?

I've used an expression to emit particles on the death of a first particle object and it works really well. What I want to do now is use the second set of particles to drive joint rotation, again using expressions.
So, the sum total of what I have now is:
if (volumeAxis_nParticle1_nerveImpulseShape.age >= volumeAxis_nParticle1_nerveImpulseShape.lifespanPP)
//if particle age is >= lifespan
{
vector $pos = volumeAxis_nParticle1_nerveImpulseShape.position;
//determines where the particles are when they die
float $emitNum = 3;
//determines how many particles will be emitted upon particle death ie 3
for ($i = 0; $i < $emitNum; $i ++)
// for variable $i, start at 0 and if $i ;
//determines the direction of the emitted particles in x, y, z
emit -o emitOnDeath_nParticle1_acetylCholine //emit the second particle object
-position ($pos.x) ($pos.y) ($pos.z) //where first particle object dies
-at velocity //now determine velocity
–vv ($randVel.x) ($randVel.y) ($randVel.z); //vector values (vv) for random velocity x, y or z
};
};

This second expression does rotate the joint, but for greater control, what I really need is another command to return the joint rotation to 0 again, ie relax quickly after a contraction. At the moment, the rotation only returns to 0 when the first nerveImpulse expression starts again. I was thinking maybe another else if line, something to the effect that when the particle count =0 (ie once all the particles have died off, when lifespanPP is exceeded), that rotate y = 0 again?

Maya says the syntax is correct, but it throws up all sorts of errors once it executes and doesn't move the joint. I'd really appreciate any advice please on how to use the second set of particles to control joint rotation, if you have any?

I'll edit this post to simplify things a bit and maybe someone can please help?

I've used an expression to emit particles on the death of a first particle object and it works really well. What I want to do now is use this second set of particles (with defined lifespan.PP) to drive joint rotation, again using expressions ie while the particles are in existence, I don't want any joint rotation to occur, but once they die off, I want the joint to rotate and then quickly return to zero ie relax quickly after a contraction. So, what I have is:

if (nParticleShape.age < nParticleShape.lifespanPP)

muscleController.rotateY = 0;

else if (nParticleShape.age >= nParticleShape.lifespanPP)

muscleController.rotateY = -0.1;

This expression rotates the joint nicely, but for greater control, what I really need is another command line to quickly return the joint rotation to 0 again. At the moment, the rotation only returns to 0 when the particle emission begins again, and age is once again less than lifespan. I was thinking maybe another else if line, something to the effect that when the particle count = 0 (ie once all the particles have died off when lifespanPP is exceeded), that rotate y = 0 again? I tried this instead, using particle count:

int $numPar = `particle -ct nParticleShape`;

if($numPar == 0)

muscleController.rotateY = 0;

else if($numPar > 0)

muscleController.rotateY = -0.1;

Maya says the syntax is correct, but it throws up all sorts of errors once it executes and doesn't rotate the joint. The error message is: