Welcome!
Wow. What a starting post.
My friends in 'show biz' used to call what you described as "working the docs".
I agree that you might be in trouble - legally - and I also agree that you've finally admitted that you've got a BIGGER trouble.
Addiction.
And my advice is to focus on that trouble first.
Surely there's a treatment facility - or even the doc who treated you gave you some info on a recovery center? There has to be something.
Well, maybe look at it this way -
Your moment has come.
I hope you'll decide to do what's best for your kids.
There's a solution.
There's always a solution.
This is where your addiciton ... can change your life for the better.
Contacting NA as soon as possible is a good idea.
I hope you keep posting and update us on your choices and progress.