I hope I understood your question right:
You can use c_trace twice, first to detect the end of the water and second to get the high of the land. Something like this:
Click to reveal..


If the land is low enough, he can climb out, else he can't. ^^


Hilf mir, dir zu helfen!