In your example, the enemy Escort unit must be regarded in the same way as an enemy Destroyer unit concerning blocking the movement of U-Boats.
So, if I understand correctly - on Germanys turn during Combat Movement the German U-Boat unit leaves the sea zone with an enemy Escort unit and launches an attack in an adjacent sea zone?
If the German U-Boat unit survives the attack and wants to retreat to the sea zone from where it came, this sea zone must be clear of any Escort and/or Destroyer units - since these units both block the movement of Submarines.
Once the German U-Boat unit has retreated to the sea zone from where it came (this sea zone must be clear of any enemy Escort/Destroyer units) - the German player can announce that the German U-Boat is inside the Pen.