I don't understand how the spike wall works, it seems inconsistent.
Consider the following layout:
W . <- S . W W
W is the wall tile, S is the spike. In this configuration the AI first goes down then gets hit by the spike, then breaks through the spike and goes left. Then try this configuration:
W . <- W . W W
In this case, the AI just goes down and smashes the bottom wall.
S . <- S . W W
And in this configuration the AI goes down then smashes through the spikes without getting hit by them.
I don't really understand how the AI will behave in any given scenario which can make solving the puzzles difficult without doing trial and error.