Okay, when programming ANYTHING, the programmer must ALWAYS be aware of something called "Order of Operation".
Try this out instead: (All I did was rearrange your code)
;Artificial Intelligence Script
;Header
desc = Transport To Entity Name
;Triggers
:state=0:rundecal=2,coloff
:state=7,plrdistwithin=40:plrmoveto=location_8,state=0
:state=6,plrdistwithin=40:plrmoveto=location_7,state=7
:state=5,plrdistwithin=40:plrmoveto=location_6,state=6
:state=4,plrdistwithin=40:plrmoveto=location_5,state=5
:state=3,plrdistwithin=40:plrmoveto=location_4,state=4
:state=2,plrdistwithin=40:plrmoveto=location_3,state=3
:state=1,plrdistwithin=40:plrmoveto=location_2,state=2
:state=0,plrdistwithin=40:plrmoveto=location_1,state=1
;End of Script
Let me know if that works. Sometimes when something seems so simple and yet is being a big problem, you could always just look at it "backwards" for an answer.
The one and only,
~PlystirE~