Wow, you completely have my sympathy. It sounds like ADHD is a real possibility here in which case you can't take it personally, there isn't a lot the best parents in the world could do.
I'm sure you've probably tried all this, but here's what I might practically try. I really hope this isn't patronising... I really have no idea what you're going through and I'm sure your parenting skills are way better than mine ...you sound like a saint considering what you're going through. Just a couple of ideas that might preserve your sanity :-)
Obviously kids love pushing buttons, so reacting positively and/or negatively to unwanted behaviour rewards them with attention (which for kids can relieve boredom). It's incredibly counter-intuitive but actively ignoring your sons bad behaviour might reduce it. You can tell him that as he stuck his middle finger up you do still love him but you're going to ignore him for 5 minutes ...and then completely blank him, talk to his brother and use silence as a short punishment. Don't even tell the other brother he's better behaved or mention your older son in any way, that's still giving a reaction: if you react negatively that rewards your child with an adrenaline rush... adrenaline is addictive. Feeling like you don't exist for 5 minutes is actually pretty harsh.
...that'll only improve behaviour if you give him special attention when he does the opposite (ie. get upset but not stick up his middle finger). You could speed it up with the "getting angry game" if he has calm moments, or you can do it with his brother if not so that he can see - just say that your going to pretend to tell him off (but tell him you're not really) and he has to pretend to get really angry but the rules is he can't stick up middle fingers or touch anyone or anything. Start with getting him to just yell for a bit (over the weeks slowly build it up until he just takes a deep breath and makes a sour face). If he does it without the middle finger really go all out with praise - do a champion style hands in the air, enthusiastically shout "great!", tell him exactly what you're praising: "you got super mad and you didn't stick up your middle finger!" and then integrate some physical contact like a high five or a pat on the back. Don't say anything else, especially not anything negating like "why can't you do this all the time" -that completely undermines the praise, just let him feel awesome for a few minutes. Then maybe use a playful challenge to get him to do it a couple of times: "I bet you can't do that twice in a row, no kid your age could do that twice!".
You don't have to do the game particularly - it just gets the good behaviour to happen more often so you can train him to associate good behaviour with feeling awesome. You shouldn't have to do this for more than 2 weeks if you can be consistent, it does stick. It is embarrassing to do, I won't lie :-D
I'm told you should work on one detail at a time (hitting at first, then the middle finger a couple of days later). Also, the praise has to be instant gratification (think video games and slot machines which use this principle to the extreme).
With getting him to do things - how about giving him a choice of two things? "can you either close the star gate or wash your hands for dinner?" - the choice offers him a sense of control, which he currently gets through acting out. Again, the whole "special praise" creates an association between doing what he's asked and feeling great about himself. Something like "That great! You closed the star gate just like i asked!" Hands all over the place, high fives, massive smiles etc (it feels stupid and he'll hate it at first but after while he'll crave it).
If he's hitting make sure you don't touch him at all when you're punishing him (obviously you'll have to sometimes). Reason being is people go into fight or flight mode when their being punished and touch of any kind makes it fight mode - it's just instinctual at any age, if a family member puts their hand on your shoulder when they are shouting at you how would you react?
In terms of using threats - make sure it benefits you if they continue whatever behaviour. If it doesn't it's non-credible - your son knows you don't want to cook tonight and it hurts you if you don't get a takeaway, so he knows he can get away with a little bit of bad behaviour. If it benefits you to follow through and you want to be given an excuse it's more credible. If the behaviour doesn't stop, YOU get to have a KFC or Burger King instead, and you'd love that. You can get to go to an art gallery instead of the planned swimming, watch a cartoon you like instead of what they like or listen to your music instead of theirs in the car. Obviously if you don't always follow through you loose credibility so never make big threats, just lot's of small ones and really make sure you want to do it. Taking computer games away doesn't advantage you (it stops them from being entertained = more work) ...ideally play 10 minutes yourself and have some actual fun if you can, force them to do co-op mode or play your favourite.
Don't forget him acting out is his attempt at using punishment to control you and the perfect response is active ignoring. Only let his good behaviours alter yours.
Saying all that the only important thing is to never to take it personally - no one is at fault, its just something that happens by chance. You're son could have ADHD or maybe he just saw the cool kid at school acting out and wants to be like him. It seems like your younger son is well behaved so use him to reassure yourself of your parenting skills, which like your coping skills seem very impressive :-)