You can store any spell of the appropriate level in the glyph of warding*
Glyph of warding states (emphasis mine):
When you inscribe the glyph, choose explosive runes or a spell glyph.
Spell Glyph. You can store a prepared spell of 3rd level or lower in the glyph by casting it as part of creating the glyph.
If you create a spell glyph, you can store any spell of up to the same level as the slot you use for the glyph of warding.
Any spell means that there is no restriction* (including longer casting times) of what spell can be cast stored in a glyph of warding.
The secondary spell is cast as you are creating the glyph, not as you are casting the glyph. The glyph is a spell effect you inscribe after you cast the spell (it's an effect that can only come into existence as a result of a successful casting).
If we compare this with the wording of Contingency which requires simultaneous casting (emphasis mine):
Choose a spell of 5th level or lower that you can cast, that has a casting time of 1 action, and that can target you. You cast that spell--called the contingent spell--as part of casting contingency, expending spell slots for both, but the contingent spell doesn''t come into effect.
The wording of Contingency requires the contingent spell be cast (ie casting completed) during the casting of contingency.
As a result, as part of the inscription process, the secondary spell must be cast. This means the total time spent casting spells for a successful spell glyph of warding is 1 hour + the casting time of the spell to be stored.
*That is, provided the spell meets the targeting criteria for glyph of warding holding the spell, which is:
The spell must target a single creature or an area.