It seems that there are a lot of things in common between buildInplaceUnpackedPackage and buildAndInstallUnpackedPackage, however, there is also a lot of duplication between the two.
In my opinion, it would be better to factor the common bits (not changing any behaviour... best effort) and have a single function for both (similar) use cases. The subtle bugs due to the duplication and not doing things uniformly for the two situations seems much worse than possibly incurring a regression in the behaviour change, especially going forward.