I think that many of the moral problems that confound the average person have at their core a confusion between innocence and in culpability. Inculpability is not innocence; one can do wrong and not be deserving of punishment for it.
For there to be culpability there must be an evil act of the will(intent) or evil act; that is, a person's deserts are dependent on their acts An evil act in the absence of an evil will may render that person inculpable of desert evens though not innocent of the act. When we say a person "meant well", it usually means that they did something wrong but that their intent was good. In many cases it is as defence for actions which in themselves were deserving of punishment.
Consider a human shield. How do we evaluate the actions of a such a person even though they may be involuntary? Clearly a human shield is shielding a combatant, the human shield is performing a function even though it may not have been deliberately chosen. In the case of a terrorist advancing behind a human shield, the shield is "protecting" the terrorist and hence is complicit in evil albeit involuntarily. The shield is not innocent, it is inculpable. Armchair moralists please take note.
Now suppose a person is being coerced into an action which is morally wrong, what is the right course of action to take, given that failing to take that action will cost them their life? Traditional moralists have argued that we must not do wrong even at the expense of our careers or our life, we must love the good more than we love life. The proper action of a person finding himself as a human shield is to oppose being one, even if it costs them their life. Now I'm not saying that this is what I would have the courage to do, rather it is what should be done.
From the point of view of the person defending themselves from an attacker hiding behind a human shield, it would appear to be morally permissible to defend oneself from the attacker even though it may injure the human shield. In fact it would appear to be justified to directly attack the human shield in order to get to the attacker. The shield is an involuntary accomplice.
The problem of course is that in attacking the shield, we may be inflicting grievous injury on one that is undeserving and that in itself is an evil.
In choosing the correct course of action we must return back to the principles of double effect. Namely :
1) That our action(defence) is just.
2) That on balance the action will result in more good than evil.
Number (2) of course is the fly in the ointment as it is a prudential judgement and hence open to a wide variety of opinion. Sometimes there are no clear answers and we have to make the best of a bad choice in the fog of war.