Freezing movement

Hey, i've got an enemy which collides with a trap. the enemy is to freeze it's movement until the trap is destroyed. All it does at the momement is try to continue in the direction it was moving in but that's blocked by the trap so it moves up and over it before the 3 secs is over which renders the trap useless and puts the enemy on a different path. Is there a way in which this can be solved? I'm using a C# script.

can you show me this script to this freezing movement?