DC Motor + Pull Solenoid + 2 Microswitches --- Rigging and Timing Question?
You might place a micro-switch at the far end of the solenoid pin's throw.  The motor enable signal then passes through the normally closed contacts of that micro-switch.  As a result the motor cannot start up until that micro-switch (and the solenoid pin) disengage.  Similarly, the motor stops the instant the micro-switch (and the solenoid pin) re-engage.  

Similarly, you could detect the opposite side of the solenoid pin and use the normally open side of the micro-switch contact.  At that point you are guaranteed that the pin is fully out of the way.

It may also help if the solenoid pin and the mating holes had a tapered shape.  This could reduce the tendency of mechanical jamming (and even provide some self aligning) of the moving parts.