Have you sourced a new door? It's easiest to replace the door assembly rather than just the flap. Two tiny screws hold it in place in the camera body. Remove these, take out the old door assembly and put the new one in place, secured with the screws. The flap is more complicated, and to my mind not worth the small saving in cost.
The most difficult bit is probably going to be laying hands on the new part, given Nikon USA's policy on selling spares.