Line trace based on results from another line trace for ledge detection

Would this work for more complex models such as a rocky cliff-face or moving objects?