The first one is correct. Strictly speaking 永い modifies レジスタンス and not 歴史, but in the end it comes down to the same thing.
The second one has quite some nesting indeed. At the most basic level we have:
これは物語である
Then, specifics are given about the 物語: [戦いと友情]の物語. (Not [戦い]と[友情の物語])
Finally, specifics are given about 戦いと友情:
少年ジンと仲間達が、バイオ軍の支配するコロニーを舞台に、(この戦いと友情を)繰り広げる
In other words, who is carrying out the fights and the friendships and where.