Which data mining or machine learning algorithm would be appropriate for learning ordered frequent patterns?
Assuming you only have these two features (var1,  var2), you might want to:
 * Create one-hot encoded features for each variable under each position.
 * Add a column on which variable is first (e.g. two columns - likely to work with trees but not with anything else).
 * Take each possible combination of variables and use that as your only input (e.g. you then take the average of out for that combination, perhaps adding some prior or smoothing).

As the comments mentioned, if out is some discrete event, maybe you'd want to instead look at Markov models.