Yes.....U can do this, but in most circumstances it is best to take down trim and door casings and replace after the new drywall is up and finished....good time to paint trim if it is needed or if trim is antique....good time to take it and have someone plane the old paint or stain off........