Sure sounds to me like a snail cam based shooter mechanism with a limit switch for the 'cocked' position.
The pseudo-code for what you're looking for looks a little something like this:
Code:
if(camLoadedSwitch = on){
camMotor.setSpeed(0);
}
if(oldTriggerState = off AND currentTriggerState = on){
camMotor.setSpeed(1);
}
oldTriggerState = currentTriggerState;
That would start the motor on a rising edge of the trigger, and stop it when it hits the limit switch, assuming this code is in a function that's called periodically.