If your headache is definitely linked to your ON, then you need a neuropathic painkiller like gabapentin, pregabalin or amitriptyline. Cocodamol won’t do a whole lot for neuropathic pain (All it does for me is make me not care about the pain any more, and unfortunately not in a nice way!)
If the cocodamol has been working and it’s just the drowsiness you don’t like, then you could try mixing over the counter painkillers instead: if you take 1 paracetamol and 1 ibuprofen, it is stronger than taking 2 paracetamol or 2 ibuprofen. (That’s why 2 cocodamol are stronger than 2 paracetamol - because cocodamol is paracetamol and codeine mixed together.) In theory you can take 2 paracetamol and 2 ibuprofen and 2 codeine all at the same time and you can repeat every 4 hours, up to a max of 8 of each type of pill in 24 hours. Not sure I would take all of that at once though! Also, it’s probably the codeine that’s making you drowsy so maybe try paracetamol and ibuprofen together first?
If the cocodamol hasn’t actually taken the pain away and the headache is a separate symptom to your ON, then you really need to get to the bottom of what is causing the pain because what the best med is depends on what is causing it. (Migraines need migraine meds. Headaches because of tight muscles caused by spasms / spasticity might be better treated by a preventative muscle relaxant rather than pain killers. Etc.) So if it isn’t your ON and the cocodamol isn’t helping the pain, please go back to your GP and get some help to find out what type of headache you have. Your MS nurse might be to help too.