It depends on your definition of the term diatonic. If it only applies to the interval structure available on the non-accidental ("white") keys of a western keyboard, then obviously there will always be two whole steps on one side of a half step, and three on the other side.
But in my experience, the term diatonic is usually also applied to some scale patterns typically found in western music, that diverge slightly from this.
Some examples below, I'll write the size of the steps in amounts of chromatic steps. So 1 for a half step, 2 for a whole step, 3 for an augmented step.
ascending melodic minor: 2 1 2 2 2 2 1 - e.g.: a b c d e f# g# a
Note that this scale produces an augmented triad (two consecutive major thirds) on step III
harmonic minor: 2 1 2 2 1 3 1 - e.g.: a b c d e f g# a
Note that this scale produces a diminished 7th chord (three consecutive minor thirds) on step VII
moll-dur (scale with major 3rd and minor 6th and 7th, combining a major triad on step I with minor triads on steps IV and V)
2 2 1 2 1 2 2 - e.g.: a b c# d e f g a
Typically used when a piece or section of music ends with a minor triad on step IV resolving to a major triad on step I
"flamenco" (also used in various other Latin, Greek, Balkan music, etc.):
1 3 1 2 1 2 2 - e.g.: e f g# a b c d e
Note that this is the same interval structure as harmonic minor, but starting on step V of the harmonic minor scale
If the term diatonic is used to refer to these scale patterns, then you could say that a half step must have at least one whole step or augmented step below and above it for the scale to be diatonic. But using this rule alone you could construct an octatonic scale: 1 2 1 2 1 2 1 2 - e.g.: b c d eb f f# g# a b
I wouldn't refer to this octatonic scale as diatonic, allthough I find that it is typically used in music that is (mostly) diatonic in nature, for example to construct a melody over a diminished 7th chord.
The example that you give: 1 2 1 2 2 2 2 - e.g.: b c d eb f g a b - I wouldn't call that diatonic if it were the base scale of a piece of music, because it doesn't have a pure fourth (5 semitones) or pure fifth (7 semitones) from the root.
If I had to give it a western name, I would call it "locrian with a diminished fourth", or an "altered dominant 7 scale".
This scale could be a western approximation of a maqam. I actually came across an Egyptian guy that sang using this scale.
In jazz this scale might be used in a tritone substitution, for example if Db7 - C is substituted for G7b9 - C. Over the Db7 chord you would play 2 2 2 1 2 1 2 (db eb f g ab bb cb dd), relative to a G in the bass this becomes 1 2 1 2 2 2 2.
So for the qualification as diatonic, it also depends whether a scale serves as the base scale for a piece of music, or only as a temporary scale in a progression.
If I had to create an algorithm to generate diatonic scales, or qualify scales as either diatonic or not, I would use the following rules:
- must have a pure fourth (5 semitones) or pure fifth (7 semitones) from the root (most should have both)
- where a fourth is filled in with two steps
- where a fifth is filled in with three steps
- may not have consecutive half steps
- may have a single augmented step (three semitones) with a half step below it and above it