It does not appear that your drawing has a band style that is called 'Depth To Invert'. So what happens in your code when the drawing does not contain the style 'Depth To Invert'? Nothing. Nothing happens. The user is not given any feedback. I would suggest implementing a function along the lines of GetOrCreateDepthToInvertStyle or at the very least provide the user with some feedback if the style does not exist.
I would also suggest that you look into PromptEntityOptions. That way you can get rid of your while loops and if statements for when you select an entity. See example:
(vb.net)
Dim opt As New PromptEntityOptions(vbCrLf & "Select Profile View:")
opt.SetRejectMessage(vbCrLf & "Selected entity must be a ProfileView. Try again.")
opt.AddAllowedClass(GetType(ProfileView), True)
Dim result As PromptEntityResult = ed.GetEntity(opt)
If result.Status <> PromptStatus.OK Then Exit Sub
This way the object selected is guaranteed to be of the type that you specify in AddAllowedClass.
In my opinion your code needs to be refactored. You are opening objects for write when you are only reading it. It appears that you are creating additional profiles when you code is supposed to be just simply adding a band to a profile view. I suggest rewriting your code and only perform the action that you originally intended. It is difficult for those trying to help as it is like trying to hit a moving target.