avr |
If it moves out it should be fine; it isn't passing through the wall, it's leaving the wall.
If it stays there then RAW, it still isn't passing through the wall, though I think most GMs would interpret it as such or possibly as another case of the wall appearing where creatures are.
No mention is made of passing thru multiple squares, just of passing through at all. Save and take damage once.