Industrial base.
To support a gigantic engineering project, you need a strong industrial base.
Expert technicians, machine operators, engineers encompassing all fields, welders and operations researchers, management people.....it is not just about having experts either, it is about passing on this knowledge from generation to generation by investing in research in colleges and universities.
Pakistan lacks a strong industrial base--there is hardly any industrial base to begin with. Investing in R&D itself will not help much if you don't have a strong industrial sector, infact, the R&D will have no impact without industry participation.
Pakistan cannot begin to transform itself without encouraging industrial sector; engineering goods constitute very insignificant portion in Pakistan's overall export. They need to get industries from china in Pakistan, start manufacturing small things in big numbers, and move up the ladder one by one. Stop aiming for BMW's or Audi, they are not gonna happen. when the industry starts making millions in profit, use that money to fund R&D and draw expertise of the industries and ensure a culture of research is passed on.
R&D phase is the most difficult one, a decade can pass without any significant results, and fortunately India has passed through this. DRDO was severely criticized in India not so long ago, but things have changed and they have started to deliver and are delivering fast. In the coming decade, they will expand even more and make more sophisticated products. To achieve this sophistication, the DRDO is tying up with private industries. That is, India has industrial base that can contribute to the R&D. Even if the R&D phase hasn't delivered, you still have your industrial base that is making millions in profit. And keep using this money to keep running the R&D.
Pakistan is far behind in this, they still need to create strong industrial sector, and only then they can aim for ambitious space programs and defense programs.