The logic for Shrines is implemented in ExampleRoutine inside the HandleShrines function. It's configured to make its way to the shrine if there aren't too many mobs around you so you can gain the active buff, which makes clearing the other mobs a lot easier most of the time.
In the old logic, the bot would get stuck on skeletons and the god mode shrine, since you have to activate those in order to cancel the effects and move on. A lot of the time, if the default routine tries to face tank the entire group of mobs under the shrine effects, it's a lot harder than killing a few then getting the shrine effect yourself. Custom routines have to be coded to have logic that works best for whatever build they are catered to though; the default routine doesn't do anything particularity specialized.
There's no easy way to configure the logic to do what you asked though. Shrines in wide open areas with no obstacles or walls around it, the idea works fine, but you start running into issues in any of the cavern or jail tilesets where there's winding paths or walls so shrine mobs spawn in places where there's little LoS to everything. It's one of the downsides of having generic logic that tries to work in as many situations as possible.