Yes, miles will get refunded if you cancel a booking, but you may have to pay a fee if you're not Platinum or above.
They can split the booking into separate PNR's if it's on UA metal, otherwise you will have to cancel the entire booking and rebook. I found this out when I tried to do a similar thing recently.
AFF Supporters can remove this and all advertisements