First of all, please keep in mind that there are two methods in which a user can remove a program from their computer.
1. By using the "Remove" button from the Control Panel.
This can be avoided by going to "Product Details" page and by checking the "Disable Remove" option from under the "Add or Remove Programs (Control Panel)" section.
2. By launching the setup in Maintenance mode and then choosing remove.
Here is where we can intervene. When the user presses the "Remove" button, you can add your own custom action that will display a text box in which the user can input a password. If the password is correct, set an installer property to a value and then, based on the property value, condition the event that spawns the next dialog.
The custom action should be added as a custom action without sequence and should be scheduled as a "Published Event" when the "Remove" button is pushed.
Hope this helps.