Yes, it is possible, or rather easy to do it (but code-wise, it might be quite big chunk of code, depending on how you approach it). Here are the steps of a possible approach, once you have the point (by user selected, or by your code identified...)
1. Create a Ray (AcadRay) starting at the point;
2. loop through all AcadLWPolylines (assume the rectangle is an AcadLWPolyline) to test: a. if the polyline is closed with 4 vertices; b. if the ray intersects with the polyline ONLY ONCE. If the 2 condition meets, the point is inside the closed polyline. (There are different way to test if a point is inside an area. You can search online, or ask Copilot/Chat-GPT... for other algorithms);
3. Determine if the closed polyline is a RECTANGLE. If the rectangle is supposed to be horizontal/vertical with its segments, then the coordinates of the 4 vertices would be the same as the bounding box. If the rectangle is rotated in an angle, you would need to test the angle of a connected segments for being 90 degree.
4. After all is done, remember to delete the auxiliary ray.