In general, whether one uses the simple past tense (e.g, "did") or the pluperfect (e.g., "had done") depends on whether or not the action has already occurred. In 1, 3, 5 the decision/action has not yet occurred definitively, so you use the simple past:
(1) If he took his driving test, he would fail.
(3) If she left her job, she wouldn't get another one.
(5) If I told him what happened, he wouldn't believe me.
Note that in 1, 3, 5, you can always use the present + future test as well. When you do this, you are "certain" these things will happen ... for sure.
(1) If he takes his driving test, he will fail.
(3) If she leaves her job, she won't find another one.
(5) If I tell him what happened, he won't believe me.
For (2) and (4), however, note that your main scenario is in the present perfect (meaning that the main action has already occurred. So in this case, I'd use the "pluperfect."
(2) If we had stayed (or if we had decided to stay) at a hotel, it would *have* cost too much.
(4) If we had invited Ben to the party (or, if we had decided to invite Ben to the party), we would *have had* to invite his friend too.
Don't forget the conditional past in the second part of the proposition as well! :)
Hope this was helpful.