Script for continously performing MD and MSD analysis

Dear all,
        I want to do forcite MD simulation and Mean square displacement (MSD) analysis continously.  For example,
1. run 200ps MD simulation and analyze the MSD
2. run another 200ps MD simulation and analyze the MSD  based on the last trajectory in first step
3. run the third 200ps MD simulation and analyze the MSD based on the last trajecory in second step
4. repeat the above processes...

Could anyone give me some help or share a script about this calculation?
Thank you.