The glaive-armed skeleton (if typical) shouldn't've been able to make an attack of opportunity against you
The Player's Handbook on Cover and Attacks of Opportunity says, "You can't execute an attack of opportunity against an opponent with cover relative to you" (151). In this case, you have cover from the glaive-armed skeleton because of the skeleton directly in front of you.
To be clear, "When making a melee attack against a target that isn't adjacent to you (such as with a reach weapon), use the rules for determining cover from ranged attacks," and, although this is merely soft cover, "even your enemies… can provide you with cover against ranged attacks" (both also PH 151). Taken all together, this should've made it impossible for that glaive-armed skeleton (if a typical glaive-armed skeleton) to have made an attack of opportunity against you, even if the DM ruled that closing the giant stone doors provoked attacks of opportunity. The one right in front of you can still stab you with an appropriate weapon under such a ruling, though.
One way to fight normally with a reach weapon despite enemies or allies providing such cover is by taking the feat Precise Swing (Eberron Campaign Setting 56). A skeleton of sufficient base attack bonus could have this feat were the skeleton created by and labored over by a being possessing the feat Graveborn Warrior (Dragon #312 38). However, given the obscurity of both feats, this seems unlikely.
RAW: The target has half cover
The Reach quality is a red herring. It doesn't affect whether or not cover applies. The only thing that it does here is allow the attacker to reach the target. With that in mind we can evaluate whether or not an attack from position 'X' incurs cover from position 'T'.
Cover
Walls, trees, creatures, and other obstacles can provide cover during combat, making a target more difficult to harm. A target
can benefit from cover only when an attack or other effect
originates on the opposite side of the cover...
... A target has half cover if an obstacle blocks at least half of
its body. The obstacle might be a ... creature, whether that
creature is an enemy or a friend.
(emphasis mine)
p.250 and p.251 of the DMG have a chart/description.
To determine whether a target has cover against an attack or other effect on a grid, choose a corner of the attacker's space... trace imaginary lines from that corner to every corner of any one square the target occupies. If one or two of those lines are blocked by an obstacle (including another creature), the target has half cover....

No matter which corner of the 'X' (I'd use 'A' for attacker, but meh) square you use, you're blocked from 1-2 corners of the 'T' square.
(It's worth noting that this may not be true for all sizes of creatures. If the target is huge, then a medium creature does not "block half of its body", for example)
RAI: Maybe gives cover.
(to reiterate) The cover description states "attack or other effect originates on the opposite side of the cover".
Let's take the following alternative configuration (Target, Creature, Attacker) and compare it against the raw text.
T - -
C - -
- - A
I don't know anyone who would say that 'A' invokes "half cover" attacking 'T'. Furthermore you can move 'A' infinitely out to the right and 'T' would still have "half cover" because you can't draw a line from a corner of 'A' to every corner of 'T' without hitting 'C' in the process.
It seems counter-intuitive to imply that a halfling gives the same sort of partial cover as a stone pillar because the smallest section of his "square" is in the way of the enemy "square".
RACS and RAF? No cover is applied.
It doesn't make sense that half (or less) of a source of half-cover would still provide half cover.
At my table? The attack does not originate from the opposite side, so it would not be considered.
What I would house-rule is:
If 3+ corners were blocked by a half cover source (i.e. a creature), then you would get half cover. Half cover is the lowest form of cover and since it's only two "lines" from attacker corner to target corners, it would get rounded down to nothing.
Best Answer
Complete Warrior includes a mancatcher, an exotic weapon that can automatically grapple targets and has special rules for grappling at a distance (since it has reach).
It has always been my impression that, the mancatcher aside as a special exception, grappling required an unarmed strike, and could not be performed without a free hand. The definition of handedness notes that
which strongly suggests that other weapons, like a lucerne hammer, cannot be. This is referring to the rule under grappling for attacking an opponent, which says
It also says
which again suggests what I was saying earlier about unarmed strikes, as does the simple fact that successfully grappling deals damage as if you had performed an unarmed strike.
Nonetheless, I cannot find any explicit mentions of a free hand being required for grappling, despite being fairly confident they existed. I will continue searching for that, but in the meantime, I only have this circumstantial evidence. After all, the mancatcher does more than just allow you to grapple with it, since it has automatic grappling and a fancy trip-like grapple option, and the “can be used in grappling” might just refer to attacking with the weapon, rather than just starting the grapple. So all this evidence is circumstantial, and could be explained a different way.
But if you are convinced, please note (as @HeyICanChan reminds me) that a character can perform an unarmed strike without necessarily using their arms or hands, so they can do it despite having weapons in hand. As @WannabeWarlock points out, this isn’t at all unusual in real life, either—leg-based takedowns while pummeling with arms and fists is a pretty typical move in mixed martial arts, for example. Doing it with armor and a big weapon in hand, okay, that’s harder, but these are fantasy heroes, so whatever. But the big, important thing here is, even if you do this, you are still using an unarmed strike. That means none of your weapon’s properties—like reach—apply.
If you are unconvinced, then the rules basically don’t really cover grappling-at-a-distance, so you’ll still have to houserule something. I suppose you could use the mancatcher rules, if you want, but that would seriously dilute the mancatcher’s value in my mind. Or you could just use the rules as-is, and ignore the weirdness where, for example, your character just instantly moves into the target’s space regardless of the distance between them.