You want to start the descend in the #move2 loop, which uses a velocity vector of _vel = [10*sin(_dir),10*cos(_dir), 0]
You may try to change it to _vel = [10*sin(_dir),10*cos(_dir), _veldown] if it is above _minalt and _vel = [10*sin(_dir),10*cos(_dir), _veldown] if it is above _minalt. Add these checks inside #move2 loop:
#move2
_vel = [10*sin(_dir),10*cos(_dir), 0]
? (getPos _heli select 2) > _minalt: _vel = [10*sin(_dir),10*cos(_dir), _veldown]
_heli setVelocity _vel
_heli setDir _dir
~0.05
?(damage _heli > _maxdmg): deleteVehicle _log;goto "eject"
_dist = _log distance _heli
?_dist < _distold:_distold = _dist;goto "move2"
deleteVehicle _log