I would recommend you to add a Do - Loop and Loop Repeat if Yes was selected. Example code:
Dim oInvApp As Inventor.Application = ThisApplication
Dim oMT As MeasureTools = oInvApp.MeasureTools
Dim oUOM As UnitsOfMeasure = oInvApp.UnitsOfMeasure
Dim oADoc As AssemblyDocument = TryCast(oInvApp.ActiveDocument, AssemblyDocument)
If oADoc Is Nothing Then Exit Sub
Dim oWrkPlanes As WorkPlanes = oADoc.ComponentDefinition.WorkPlanes
Dim oResult As DialogResult
Do
Dim oOcc As ComponentOccurrence
oOcc = oInvApp.CommandManager.Pick(SelectionFilterEnum.kAssemblyLeafOccurrenceFilter, "Select Part...")
If oOcc Is Nothing Then Exit Sub
Dim oPoint As WorkPoint = oOcc.Definition.WorkPoints(1)
Dim oPrxPoint As WorkPointProxy : Call oOcc.CreateGeometryProxy(oPoint, oPrxPoint)
Dim dX As Double = Round(oUOM.ConvertUnits(oMT.GetMinimumDistance(oWrkPlanes(1), oPrxPoint), "cm", "in"), 3) ' YZ Plane
Dim dY As Double = Round(oUOM.ConvertUnits(oMT.GetMinimumDistance(oWrkPlanes(2), oPrxPoint), "cm", "in"), 3) ' XZ Plane
Dim dZ As Double = Round(oUOM.ConvertUnits(oMT.GetMinimumDistance(oWrkPlanes(3), oPrxPoint), "cm", "in"), 3) ' XY Plane
oResult = MessageBox.Show("X - " & dX & " in" & vbLf &
"Y - " & dY & " in" & vbLf &
"Z - " & dZ & " in" & vbLf &
"Yes - Repeat the action.", oOcc.Name, MessageBoxButtons.YesNo)
Loop While oResult = DialogResult.Yes