Question:

What are the scenario’s that CSM gets locked automatically  and want to know weather its deterministic or not?

Answer:

If a password is programmed into the flash, the CSM is locked on reset and stays this way until the password match flow is executed (refer to the System Control and Interrupts guide for your particular device). 

If an application has unlocked the device, it can force a relock by writing a 1 to the FORCESEC bit in the CSMSCR register.

Please also refer to this wiki page: http://processors.wiki.ti.com/index.php/Code_Security_Module_FAQ_for_C2000