Hi, I was working on the same issue a bit of time ago, and achieved some pretty good results.
dl.dropbox.com/u/41931267/Improved%20example.capx
This example shows how to detect more than one obstacle, but there is no need for this, of course.
(Most of the credit goes to R0J0Hound)
EDIT: I should say that I didn't look at your file because i haven't upgraded to r59 yet.