It seems like the obvious path would be around solid obstacles. I've never driven a Boeing 737, but will the autopilot really fly you directly into an obstacle with no warning at all? My understanding was that these vehicles are equipped with radar and collision avoidance systems.
Aviation auto-pilot will most definitely fly you into things.
Systems exist which will override auto-pilot in the event of such happenings, like Auto-GCAS (ground collision avoidance systems) and equivalents, but these aren't really designed for sudden obstructions -- they are mostly designed to help regain level flight if a pilot becomes unresponsive during maneuvers and is pointed in A Bad Way -- but auto-pilot is not going to be engaged during such flight, anyway. But systems like this do have authority to disengage whatever other systems that may interfere with their operation, like auto-pilot.
There are many onboard systems to allow awareness of such conditions that will result in collision, but not much in control of actual flight characteristics on any but the most advanced or experimental planes.
I once saw a near miss of 2 civilian planes. One was taking off from an airport next to Lake Superior, and the other was a float plane taking off from the adjacent bay. I only noticed because I heard the engines rev up as they took evasive maneuvers.
Generally, non-military aircraft avoid collisions using radio broadcasts from various beacons (their own and those of other planes). Actual radar systems for detecting non-broadcasting obstacles are, per Wikipedia, generally only found on military aircraft. So if you define "an obstacle" as something that is not a plane broadcasting a beacon, then, yes, a Boeing 737 would probably run directly into it if it were somehow in the path of the autopilot.
Yes it will, autopilot just keeps the heading and the altitude.
There may be other sensors onboard that help with detections (it is a lot more expensive after-all) but the autopilot control system does no such thing.
Even with all the sensors onboard, the 747 would most likely run into something without assistance, in fact I've seen a few cases of this on Air Disasters.