Hi Roger, Tuck's advice is right on. There are multiple addiction forums -- you're not an addict. But these forums will give you the support you need.
As far as taking the codeine longer than you needed it, we don't judge. Objectively, its a mistake, as you've learned, but I don't consider it to be a character flaw.
The good news is that codeine is one of our weakest opiates, and using them for a year is not so long.
The jumping legs is a condition called myoclonus. The medication clonidine helps with this condition. Here's an old post with information and reports from people who have used it:
http://www.medhelp.org/posts/Addiction-Substance-Abuse/clonidine-dose-in-opiate-withdrawal/show/51986
However, I imagine that you'll be sleeping normally very soon. You are over the hump and your withdrawal symptoms should already be subsiding in other areas -- for instance, the runny nose, the diarrhea and cramping, the sweating, and other symptoms of withdrawal.
Because opioid tolerance and dependence is a problem of the central nervous system, withdrawal or "opioid denial syndrome" causes the twitching.
But it will pass, and if I'm right, it will pass soon.
Please be careful with the alcohol -- a drug that does more damage to the GI system than any other in my opinion. It's a killer for many other mammals and for people without the genetic makeup for proper metabolism.
Still, I know the need for sleep and the annoyance of myoclonus.
Best wishes for a speedy recovery.