I've been testing this and I can't seem to get it to work satisfactorily.
Addendum:
First of all the code is not correct. The first line is:
:state=0, plrdistwithin=25, colon:state=1
It should be:
:state=0,plrdistwithin=25:colon,state=1
Same thing goes for the second line. The second thing is that, as Ply stated you needed to reverse the states. However, there is still one more issue and that is using the distance of 25 units. Being further than 25 units is no problem but 25 units is too close and I found the player still runs right through it. Even 30 can be too close. I had more success with 40 units. You can play around with it.
I also found that it was not always consistent. Sometimes the player gets blocked and then other times the player seems to be able to sneak through the wall. One way to prevent this from happening is to turn "Always Active" on. It is found under physics. Just indicate "yes" to turn it on.
When a person codes, you will find that there can be more than one way to do it. For example you can put the following in the "start" AI.
;Artificial Intelligence Script
;Header
desc = Instant On with collision off
;Triggers
:state=0:setalphafade=100,coloff,runfpidefault=1
;End of Script
You can then leave the original states as they were because when the level starts collision will be off.
Just some things to think about.
BTW, I seem to remember that you cannot have spaces within your line of code. In the code you have presented you have spaces after the commas. This is a common mistake. When I first started I did the same thing.
The past has a lot of memories to hold onto; but, today is chock full of new adventures, and, the future shouts out, "The best is yet to come!" -- TerryC