Hardly a waste of hours, in fact quite the contrary. It gave you experience of flying on instruments which will benefit you on your road to gaining an IR. You will need to have met the minimum hours requirements for the CPL and IR issue and doing an IMC will have been way more productive than burning holes in the sky.
No credit from the IR for doing a CPL.