If you are in QC/ALM version 11.52 or higher, there is a new BugLinkFactory to assist with the linkage. This makes things ''a little'' easier.
Try the below example:
Function Step_FieldCanChange(FieldName, NewValue)
On Error Resume Next
'If the ST_STATUS field is changing...
If FieldName = ''ST_STATUS'' Then
'If the new value is going to be Failed or Blocked...
If NewValue = ''Failed'' or NewValue = ''Blocked'' Then
'Get the Step ID of the current Step.
StepID = Step_Fields.Field(''ST_ID'').Value
'Get the Step factory from the StepID
Set StepFact = TDConnection.StepFactory
'Get the Step object from the Step Factory
Set StepObj = StepFactory.Item(StepID)
'Get the BugLinkFactory from the Step
Set BugLinkFact = StepObj.BugLinkFactory
'Set a blank filter to find all the current defects in the BugLinkFactory
Set BugLinkFactFilter = BugLinkFact.Filter
'Apply the filter and add the filtered items to a list
Set BugLinkFactList = BugLinkFactFilter.NewList
'Check the list to see if it is empty
If BugLinkFactList.Count = 0 Then
'Inform the user.
MsgBox ''You must link a defect.''
'Block the status change
Step_FieldCanChange = False
'leave
Exit Function
End If
'Kill the objects
Set BugLinkFactList = Nothing
Set BugLinkFactFilter = Nothing
Set BugLinkFact = Nothing
Set StepObj = Nothing
Set StepFact = Nothing
End If
End If
On Error GoTo 0
End Function