Is it explained in any of the side comics/web blogs/etc.... why they couldn't revive Optimus with the all spark fragment like they did with Megatron? And why is every piece of tech that comes to life (by the all spark) evil or evil like and start shooting everything thing up?
The Transformers that are newly-created by the Allspark aren't evil - they're just chaotic. I'm sorry, but I can't remember if there was an explanation for your other question; let's see if someone else can help you.
I know that they had to off a robot to revive megs.. probably not an option for the autobots. If they offed him just for a piece of allspark, then I don't get why Sam's didn't work for prime... (maybe I have Alzhiemer's but I dont even remember where it went after a while. ) Also The allspark seems to favor the decepticons in the movies tho, as it restored Frenzy completly but did nothing for BB.
As far as reviving Optimus with the shard plot hole, I have a few theories. 1. Megs was repaired, possibly extensively though the time between needing parts and using the shard was mere seconds. Either way Megatron was repaired by using parts from the other decepticons, predominantly "Ze little one". Optimus was not repaired despite excessive damage and may not have been repairable without using parts from other transformers. remember even after his resurrection he is still very weak until he is repaired using parts from Jetfire. The difference in their level of repair meant one could be re-aninamted with the shard and one couldnt. 2. Megs was revived with a "shard" where as Sam had a "sliver" There could have been a large difference in the size and power of the two meaning the sliver would not have been enough to revive someone. Jetfire could have been re-animated due to his lack of damage and the fact his stasis lock was due mainly to loss of power. This theory is interchangable with my first. 3. Theres something in the novel I think saying that only the matrix has the power to revive a Prime. Although the same novel claims only a prime can kill a prime which is against Megatron killing Optimus. 4. A wizard did it. Seriously, I personally think its 1 or 2 or a combination of both. I dont know what the official explanation is if there is one.
With Megatron, he was repaired using parts from the constructicon. We also have to remember that the allspark was was jammed into his chest, and maybe it just overloaded his spark, and not merely kill him; just put him in some sort of stasis lock. And like others have said, A shard was used to revive Megatron, while sam had only a sliver. Huge difference in the power that is possible..
When optimus died megatron, starscream and that other guy didnt so Sam had to run away with bumblebee while the autobots fought off the decepticons, Then Optimus was brought to the nest base, Out of sam's reach. Now Sam could have gone to the base and brought the shard with him but the Fallen had already made his speech so it would have been too dangerous for sam to go back. Then in the desert Sam already had the Matrix dust so it was too late to use the shard. Also he couldnt have just ran up to optimus in the forest becasue at that time Mikela had the shard.
The most probable reason I can think for it, it's because Sam simply didn't know the sliver could revive optimus. Yes, he used it to activate Jetfire, but this was becase Wheelie told him to point the sliver at him, he didn't knew why or what would happen.
Given the size of the Sliver Sam entrusted to Mikaela, I highly doubt it would've been enough energy in it to ressurect Optimus Prime from his untimely death. Not to mention, Sam was running for his life (as per Optimus's final words), I doubt the first thing in his mind was "Find Mikaela, get the sliver and ressurect Optimus". The Autobots didn't know about the sliver either, so no go there. The only time they seemed to remember the AllSpark sliver Mikaela had was when they needed it to reactivate, not ressurect, a dormant Jetfire. With the peramiters of its size, I can see something tiny like that reactivating a sleeping transformer, just not bring one back from the dead. Now the chunk of AllSpark that the Decepticons used to revive Megatron, I could see bring him back due to its size and the fact that it obviously had more energy than the sliver did.