I've thought about this too. I really hope they put this into the AI in OFP2. Anyway, it could be done in OFP1, although with some difficulty.
There is a "nearestobject" command, so it would seem pretty easy to do. However, there is a problem: you can only get the nearest object of one specific type with this command. That means, you can only get the nearest jeep, or the nearest ammo crate, or the nearest building of one specific type.
I have an idea for a solution to this, but I haven't gotten around to doing it yet. The thing to do would be to make a function that loops through a large number of "nearestobject" commands, finding everything that you can think to enter (such as bushes, vehicles, fences, et. al.). It then returns the closest object out of all of these. I did something similar to this my manMG script, which makes the closest unit run to man a MG after its gunner dies.
The main thing stopping me from doing this is (a) I don't have Resistance (I'll cough up the $10 bucks for it eventually), and (b) I don't know the names for terrain objects, such as bushes, trees, etc. If anyone knows these names, or how to find them, it would be great.
After making that function, it would be fairly easy to make a script like the one you are talking about. I was thinking about this for other reasons, such as flanking, retreating, etc. Maybe all of these functions could be put together into one big AI script.
Barron out.