Have you thought about turning states evidence on this gang? If they are really behind all or at least a lot of these robberies you might have some leeway room...I don't know what that could get you, but with any hope some sort of monitored probation and witness protection...
Another option is to use the duress argument. If you can prove that a "reasonable person in similar circumstances" would have honestly felt that your ONLY option in order to preserve innocent lives was to commit a lesser crime then you might have an affirmative defense. The key for the duress argument is showing why other legal options weren't available, such as the police or removing your family/friends...proving this might be as simple as a threat that if you told they would retaliate before police or friend/family removal had a chance to be effective. The duress argument will not work if the threat is just against you...but committing a minor crime as the only option a "reasonable person" to protect innocent lives is analogous to driving 120mph to the hospital because your wife is in labor. The courts are charged with balancing the facts and you just have to show exactly what you said on here. The hard part is how..."heresay" is only admissible in court under vary limiting conditions, such as a dying declaration. So just saying they made a threat is not necessarily sufficient. I mean, the best thing in terms of defense would be an unimpeachable witness testifying on your behalf, but I assume if that were the case you wouldn't be here. If you were to have un-tamper-able and irrefutable documented or documentable evidence of any type that could help...or you could wear a wire yourself and get some (NOT RECOMMENDED due to danger, however courts have held that only one party needs to give consent for secret audio recordings, and there are some pretty inconspicuous stuff out there in private dick shops for not too much money, certainly compared to that 20 grand)...
Running away would mean every time you look over your shoulder you'd worry when they'de catch up, and unless you stay waaaay off the grid changing your identity yourself in a way that will fool anyone requires some connections, or the ability to do research, critically analyze the weak points, and perform some good ol' social engineering...you know like finding a secretary at the vital records department, taking her on a few dates till she feels she could trust you, and asking her to show you her work that you just find soooo fascinating, then insert an algorithm into the computer and you have a birth certificate...Bureaucracies lose things all the time, the'yre good at that so if your in the computer they'd be happy to help you replace yours as well for your birth certificate...and once you have that the rest isn't bad...similar stuff with schools to get transcripts etc....note none of this will hold a deep check but don't give them a reason to: don't list any of these people as references, apply for a security clearance job etc...if you do this successfully you'de be scot free somewhere else as long as you NEVER EVER EVER contacted people from former life, and if you did it would be one sided letters from you, preferable something relatively untraceable like a JonDo computer proxy network. However if unsuccessful you'de be facing a hell of a lot more than 3-6 months.
So reducing your variables and simplifying for clarity: Run, stay and fight, or take whats coming to you, or give states evidence...each of these of course have sub-options, such as how much you escape your past life if you run, or what you do if you take it to trial including attempting to capture threats by the gang on tape.
I of course left out the trivial solutions, like drugs or suicide...because they are trivial and you are better than that...Those are null options IMO. The option that is no option is not an option at all.
However, everything I listed involves certain potential risks. The risks involved are generally proportional to the gain however. You might want to consider your level of acceptable risk...for example suppose you were told if you pleaded guilty they would drop the charge and you'de be guaranteed 6 months and if you took it to trial with this evidence hypothetically your lawyer feels you have a 75% chance of 8 months in jail (with that or freedom the only possibilities). Well, the effective value of time incarcerated might be the same, however from your perspective you would only be adding a third to your sentence for a 1/4 chance of exoneration. The first few months are the worst, maybe that chance at freedom would be worth the chance at a little bit longer stay...
Anyway, don't just see this as a wall of text to avoid like the plague. I hope that this will help. Note I am not advising nor giving information on how to break any laws. I'm not a lawyer either, but I pick up a little something here and there...I'm an autodidact. I'm an engineer, and that just means that I know how to analyze options and choose the right ones based on constraints (such as desire for freedom vs loathing of jail vs physical danger vs leaving friends and family and the acompanying 2-sided emotional pain vs the technical difficulty of some options)...To determine how YOU feel about all of these constraints, try a decision matrix. List how important each of these things are on a scale of 1-10 in one column, and the options available in the first row. Then cross multiply...
Hope this was helpful and let me know if you can...I never like to see people hurting.