Task Switching and Cycling AI

Hello UE4 Community! I am currently working on a horror game in the 3rd person template. The game is mostly centered around the enemies unique AI. Each enemy is different in the way it acts, so you have to find the best way to go from floor to floor in the building without being caught by them. One of them is a blue Cookie Monster type character (the enemies are haunted Puppets) that peeks around the corner at the end of hallways. If you get to close, he’ll chase you. He can only run to the end of the hall, where he then runs back to the corner and the cycle continues. The problem I’m having is getting him to stop running after the player only when the player is out of the hall and then running back. I wouldn’t call myself a Novice to Blueprints, but I’m definitely not advanced, so either something simple is going over my head, or it’s just a little to complicated for me. Any help would be appreciated! Thanks in advance!