Optimizer can be configured to have dependent variables constrained by the value of another value in the preceding time period.
I suggest that you separate a given time block into a dynamic time series consisting of hours, blocks, etc. For example, if there are 4 time blocks per day, the variables can be set up like so:
Variable 1: Task 1 Scheduled? (1 = True, 0 = False), dimensionalized by Time Block
Variable 2: Task 2 Scheduled? (1 = True, 0 = False) dimensionalized by Time Block
List: Time Block with a Previous Property
Block 1 (Previous: BLANK)
Block 2 (Previous: Block 1)
Block 3 (Previous: Block 2)
Block 4 (Previous: Block 3)
Constraint 1: Task 1 <=1
Constraint 2: Task 2 <=Task 1[LOOKUP: Previous Time Block]
This will constrain Task 2 so that it can only be scheduled if Task 1 was performed in the previous block. We have some example of this logic in action with a workforce scheduling optimizer where shifts must be contiguous.