Test when your player is moving not sure what method of input your using but you could create a variable and when you are moving for example keyboard w is down add sub event trigger once set value player moving to 1 then test if player moving is = to 1 on the enemy use path finding or whatever system you have in place then on w released same thing add sub event trigger once set player moving to 0
Eaxample
Add variable: player moving=0
Set enemy pathfinding diagnols off so guards only move up and down
W is down:
Trigger once while true: set player moving =1
W released:
Trigger once while true: set player moving =0
Player moving =1 : guard find path to
Trigger once wherever. X .y
Guard On path found:Move along path
Player moving =0 Guard pathfinding stop
Trigger once
Note you could also do this with out the variable by searching for path when w is down trigger once in sub bracket
Then on w release stop enemy path finding.