In this fic, the Aesir are facing an outside force attacking them. These beings are able to figure out where to attack because they can predict/see the future (I think....I don't remember the exact way they do this). Either way, Asgard is losing and Odin goes into Odinsleep (i'm pretty sure...) and puts Loki in charge. Loki is able to combat the invading force because he is able to hate and want the destruction of Asgard and everyone, which attracts this invading force to where Loki wants them before Loki changes his mind at the last second and has his forces decimate them. This happens repeatedly. BTW, these beings come through portals. I think we learn that this is probably the reason Loki was put in charge, because Odin All father knew his chaotic self etc. could create a situation in which to win.
Now somewhere in there, Thor comes back and I'm pretty sure that Loki and Thor end up in a relationship....there might have been some manipulation, but I'm pretty sure Loki puts Thor in charge of the troops....?
Anywho, I really hope this is enough to spark someone's mind! It's been driving me crazy, especially since I thought I bookmarked it!
THANK YOU for taking the time to help :)