Yes, it is possible.
You should know how mutch vertices your terrain have (for example 80 vertices on X, 60 vertices on Y-axis). With vec_dist from your Entity to the MIN_X and MAX_Y (in a Vector of course) of your Terrain you can see which Vertex is the nearest to your Entity (maybe you should adjust this because you've scaled your Terrain in WED).
I wrote a code and it works. Maybe I should post it here.

I hope I have helped you with my bad english!

P.S.: OK, I've made a code, but I can't use it with vec_for_mesh, because it doesn't work corectly in my Version. But JCL said that this is a Bug and will be corrected soon.