With VBA code, there are 2 ways to do it, as I can think of:
1. Use GetEntity() as you may already use. After getting the first polyline, you compare it with all other polylines in the drawing (of course, you can narrow down the polylines to be compared by creating a SelectionSet with a small window selecting around the picked point). Since the 2 polyline share a common segment, both polylines must have 2 equal vertices.
2. Use GetPoint() to pick a point that snaps to the common segement. Then create a temporary AcadPoint object and use IntersectWith() to find the 2 polylines.
To make things easier, can you just use AcadSelectionSet.SelectOnScreen()?