Why not just have multiple sensors?
Apparently though, something as simple as a bed sheet can throw off a sonar sensor. Myth busters tried it out :-p
and for like a failsafe sort of thing, why not just have limit switches on all 4 sides so that if it hits something, it just goes back to whatever position it was in 2 or 3 seconds before and then tries again?