The shield blocks 400 damage regardless of magic resistance.
The 30% Magic Resistance is calculated everytime,as it is passive.
So, for the Fingers of Death Example :
If you dont have the shield activated, it will deal -30% damage.
If you do, it will still dealing -30% damage, and the rest of the damage will be used to
lower your "shield" ammount of Magic Block.
Lion's ultimate info can be found here
Level 1 : 500 Damage - 600 With Aghanim's
Level 2 : 650 Damage - 800 With Aghanim's
Level 3 : 850 Damage - 1025 With Aghanim's
So, 30% Magic Res. would lower the damages to:
Level 1 : 500 - 150 = 350 Damage Or 600 - 180 = 420 With Aghanim's
Level 2 : 650 - 195 = 455 Damage Or 800 - 240 = 560 With Aghanim's
Level 3 : 850 - 255 = 595 Damage Or 1025 - 307.5 = 717.5 With Aghanim's
So, ignoring any extra Magic Defense that the heroe may have, you would be able to completely ignore the ultimate's damage only if he is at Level 1, and without Aghanims.
Otherwise, you would take some extra damage.
Hope it Helps.
Source : Self tested @ Dota 2 with Friends.
Best Answer
The towers will attack enemies in this order:
The tower will switch targets if:
Last one is a weird mechanic that got greatly exploited during last few months,if you get targeted by the tower and click attack button and click on friendly creep the tower will start attacking the next target as if you got out of the attack range.It is getting its popularity since it enables you to attack tower with minimum interruptions(running away+running back from the tower range).To me it looks like a major bug since it makes no sense as a mechanic.
The thing that you mostly experience during the game is that you move inside the tower range (while it is attacking another unit), and then click attack on an enemy hero, which will make the tower attack you.
More discussion here and here.