For an easy scenario:

Player green should place the yellow wall, if he doesn't and just moves (following the yellow arrow since that is his closest path to the end) player blue will just place a wall in front of him forcing him to have to backtrack to the one path around that series of walls. In actual gameplay this can get more complex since your best action might be placing several walls trying to make a safe path to the goal instead of moving or trying to block your opponent.
So right now the way I'm (or I was) looking at it would be:
If my path is shorter (using A* and Manhattan distance [with some weight to try and avoid paths right beside 2 walls])
a) see if placing a wall defensively is a good idea (not sure how to do without brute force since the best position in this scenario won't be from the best paths [usually])
b) move
If my path is longer
-find my opponents best path
-for each wall position on their best path try placing a wall and recalculate my best path and opponents
-pick the one that gives the best results.

Find content
Not Telling