Thanks newt for your raycasting suggestion, that's a good idea.
I seem to have found a pretty good solution. Here's the capx for anyone interested.
Basically, I cast two parallel rays, then use some simple trig to determine the angle of the wall. Once i know the angle of the wall, I just use 'push out solid at angle' in the opposite direction to the wall.
It has problems with sharp inwards corners, but those can easily be fixed with some invisible collision if need be.