combine_actions: Combine consecutive actions into a single action
Description
Combine the action pattern described in old_actions into a single action
new_action. The timestamp of the combined action can be the timestamp of the
first action in the action pattern, the timestamp of the last action in the action
pattern, or the average of the two timestamps.