If you want to have precise control over an enemy's movements, you should either use kinematic body or area2d. I personally like to use Area2D for enemies, and then decide in code if I want the player to be knocked back or something else when they "collide". If you don't program any behaviour, then the player will be able to walk through the Area2D freely. This may or may not be what you want.
In your case specifically, it sounds like using either an Area2D or a Kinematicbody2D along with some Raycast2D nodes (to detect when the enemy is near a wall, or vertically, if it is nearing an edge) will get you the behaviour you are looking for.
In general though, this is how I understand the different physics bodies:
Rigidbodies are more suited for things that you don't necessarily need precise control over, but still want to simulate and respond to physics. Imagine a beachball. It will bounce and roll and respond to gravity when it is kicked, but it won't move other objects unless they are also rigidbodies. It does all of this for free, meaning you don't need to program its behaviour. It acts according to the physics engine.
Kinematic bodies are physics objects, but they only react to physics events if you tell them to. For example, they will collide with other kinematic bodies and rigidbodies if they are on the same collision layer, but they wont bounce or reflect according to physics unless you tell them to specifically in code. They will not do anything that you don't explicitly tell them to do (or if they are being aggressively bullied by another kinematicbody....)
Kinematic bodies can push around rigidbodies, but rigidbodies cannot push around kinematic bodies (unless you specifically code the kinematic body to respond to a contact with a rigidbody. I generally don't like to handle it that way but it is possible AFAIK)
Area2D is not a physics body, so kinematic bodies and rigidbodies will not interact with them, unless specifically coded to do so. You can use the "on body entered" signal or "on area entered" signal and their variants to program behaviour between these.
You can still directly control a rigidbody using something called integrate forces but I think that is a little over the top for the enemy you're describing.
Some more examples of this:
RB meets RB, they will interact completely according to physics, without being coded to do so. Two beachballs, they can push eachother around and interact with the physical environment "freely" without being explicitly told how to react.
KB meets RB, the KB will push the RB around.
KB meets KB, they will interrupt eachother's movement. Generally, I think they both end up stopping eachother from moving if they are trying to move through eachother. Depends on exactly how they are programmed though. I have had enemy AI as kinematic bodies end up pushing the player kinematic body around if the player got completely swarmed/a lot of agents on top of it at once. It was like the player was frozen in place because it was unable to move these immovable objects around. But if it was just one KB object attempting to through another KB object, it should be the same as if both objects are trying to move through an immovable wall, and nothing moves.