How do I determine whether to use 次 (cì) or 遍 (biàn) in these sentences?
From 《现代汉语词典》: (I'm omitting other unrelated descriptions of either word)


  次: 用于反复出现或可能反复出现的事情
  
  遍: 一个动作从开始到结束的整个过程称为一遍


Which is saying that 次 is used for things that (may) happen/appear/... repeatedly.
And 遍 refers to the whole process (from the beginning to the end) of an action.



The following explaination may be not that accurate:

次 seems to be saying that how many times you started to do something, but not quite care about how it persists.

In 2), the full action is required (from begin to end) so it is 遍。

In 3), the first blank, if he did twice consecutively, then it is 一次, but 两遍. Each 遍 is the full process from begin to end. If he did it once in the morning, but once in the afternoon, it is 两次. So maybe either is OK. For 下遍, it is not OK for me. But you can say 下一遍.

1), 4), 5) are all describing how many time a thing happened/happens/will happen, so they are all 次.