You could say, min(a,b) < x < max(a,b) or maybe x = at + b(1 - t) for some 0 < t < 1 if a and b are real numbers. Probably the simplest way is what you said, x is between a and b.
I've written a proof which ends with the (simplified) statement:
"Statement A is true iff a<x<b OR b<x<a"
This is because b is not necessarily greater than a. In plain English, "Statement A is true if and only if x is between values a and b"
I wonder if there is some way of combining the chained inequalities, hence being able to get rid of OR.
Anyway, having time on my hands having been dragged there by my wife, I thought about this question. Again, it just popped into the ole brain with the help of Guinness.
Do it with a distance function. is between if and only if are three numbers such that