Debug your code to step through it line by line and that will show what the problem is. What is "replacements.Count" for example? If it is 0 then your code will loop forever, but only you can know that. If that is the issue try
If nextCheckIndex = replacements.Count Or replacements.Count = 0 Then
MessageBox.Show("Check complete.")
nextCheckIndex = 0
End If