Your requirement is actually a 2-stage task:
1. after user clicks somewhere in the editor, you need to find of if it is enclosed by a boundary, be it a single entity/rectangle, circle..., or be a boundary formed by multiple entities. However, if your code somehow already knows which entity (a rectangle polyline, for example), then obviously there is not need for user to click inside of it.
2. Once you find out the boundary, you then decide how to "highlight" it. If it is a single entity, you can simply call Entity.Highlight() method. If it is the boundary formed by multiple entities, you may need to draw the tempotatry boundary, using, for example, Transient graphics.
You can call Editor.TraceBoundary() method to find out the enclosing boundary of a point. The method returns a DBObjectCollection containing non-database-residing entities. You can use them to drawing Transient graphics. these links should be very helpful:
https://www.keanw.com/2010/06/tracing-a-boundary-defined-by-autocad-geometry-using-net.html
https://www.keanw.com/2012/09/creating-reactive-transient-autocad-geometry-using-net.html