Also, right when they were first starting to make some progress making energon on Earth, Starscream immediately wasted their supply. If the Decepticons are like any organization I've ever seen, the whole army soon got a memo that they would have tighter limits on their energon usage going forward.
Offering an in-universe explanation for why the military coup faction started shooting to kill is always going to be an uphill battle.
That said, I'd like to think that there's more to it; every time we saw Cybertron in S1-S2, it was ghost world, practically unchanged for millions of years, with only a handful of local inhabitants at any given time. While it's never been clear how easy it was to create new transformers (without "supernatural" aid like Vector Sigma), the extinction of the race was certainly a reasonable fear on both sides. (In MTMTE, when asked whether Cybertron still exists after so much time, Megatron says "it must"... but whether this was faith or wishful thinking is up for interpretation.)
It's possible that after Megatron's return and relatively steady supply of energon that things "got better" on Cybertron, at least in the Decepticon capital city, leading to an influx of Cybertronians - whether revived from stasis, returning from space (a la IDW), new robots, or something else is up for debate.
Thus I'd LIKE to think that for all his bravado, Megatron didn't really want to kill the autobots, but conquer them; they're his civilian workforce after all. But by the time of the movie, the autobots' compassion and heroism had lead to them becoming a military threat. That, combined with a stable cybertronian population, means the kid gloves are off.
When I wrote my view, I was more thinking along the lines of what I gaged from the movie, in Starscream's mind, the real threat was the Autobots moon bases while Megatron wanted to cut off their energon stocks, and then attack the moon bases, likely his plan was to not only slip pass their early warning systems but land safely and launch the surprise attack, if not for Daniel & Hot Rod, they would of likely suceeded. The whole internal fighting thing, has been apart of G1 outside of Starscream we had triple changers trying to become leaders and we saw when Megatron was out of the way, the cons battling to be leader inside of Astrotrain and my guess is, they came to an agreement that Starscream should lead for now and I believe he would launch a full scale attack on the moonbases, but the Autobots would have the advatange of knowing the lay out and not having to use a lot of energon to get from the moons to Cybertron, thus they would have a lot going for them and reinforcements from Earth would help!
In universe, I think there's an argument that there was a parallel battle happening at the Ark with the S2 characters not featured in the movie; a distraction that occurred about the same time as the battle for autobot city; making this part of a 2-progned attack on the Autobot's Earth strongholds. If they could make Earth
unsafe for the autobots, then it's possible Megatron could steal enough energon to put up a much bigger fight on Cybertron, while splitting the autobot's focus.
Also, it's hard to take Starscream's criticism seriously; he likes to poke the bear. Of course the lethal weapons on Cybertron's doorstep are a greater threat to Cybertron than Autobot City on EARTH... but Autobot City is where they're getting energon from for the attack; cut the energon supply, no attack.
As for bickering over who is the leader, I think you're underestimating the scale of the threat. Either Starscream wins, at which point assassination is on the table, or he loses, and he's removed from power. Fighting about who gets to wear the crown is a bit meaningless; ESPECIALLY since the movie tells us who wins (and that isn't changed by removing Unicron).
As for Megatron & the Junkions, the Junkions at first were hostile but it was Hot Rod using the Universal greeting and the energon goodie that enabled them to become friends, we know Megatron was tossed out into space by Starscream and I believe he would of drifted to Junkion in the end as all space junk ends up there and a junkion mistakes him for another junkion who might of been just born and needing parts to become operational again, after all, their culture is centred around junk and TV! The only con that we have to try and guess what they would do in this, is Shockwave, his only appearance that was speaking was telling the cons to scramble, before he got crushed by Unicron's hand and he was apointed by Megatron as the guardian of Cybertron, some 4 million years prior and I would like to think, he would not only kept energon stocks hidden from Starscream, he likely let the most foolish ones follow his folly/gamble to attack the moons, thus not all of the Decepticon forces would go, likely during the 4 million years, a lot of Decepticons chosen to follow Shockwave as he did not disappear off into space!
Here's the thing: Space is BIG. The idea that Megatron would crash land on a planet (non-fatally), let alone one with Cybertronians, within a few weeks is statistically unlikely. With that in mind, I think it's far more likely that Shockwave or Soundwave might fly out to pick him up when they get a chance, and that chance is probably statistically well before he hits a planet.
That said, if the question is "What if a critically injured Megatron crashlands on the Planet of Junk?" I think you're right, without Soundwave (or some ad hoc IDW-esque character development of Thundercracker), Megatron's going to be surrounded by the Junkions. But I don't think they're going to just KILL the trespassers; maybe Megatron puts up a fight, but for all we know once he's passed out, Wreck Garr's crew could stabilize his position. At this point, we can extrapolate what G1 Megatron might do; think he initially reacted to Skyfire; I don't see Wreck Garr being opposed to repairing their visitors and sending them on their way... although, perhaps, without their weapons. The question, then, becomes whether Megatron can slick talk him into getting his weapons back (or turns into a gun for Thundercracker to hold, to shoot his way out of things?).
Re: Shockwave - We've actually seen how he reacts to Starscream in the show; it's possible that he's feigning loyalty here (although, was he even at the ceremony?). In any case, I can't see Shockwave openly defying Starscream in a state of emergency like this; maybe he slips off to look for Megatron, but as you say, he does have his duties, and those are even more important given Starscream's putting his charge at risk.