I believe that in your wfGetUserActions you should iterate wfGetUserRoles instead of UserRoles
Case "3" 'Directory Role<br/>
RoleRestrictionsExist = True <br/>
Forall Role In wfGetUserRoles(paramDoc, False, True) 'not UserRoles<br/>
If Role = RestrictFormulas(i) Then <br/>
Passed4 = True<br/>
End If<br/>
End Forall<br/>
End Select