For my money/at my table:
Casting the spell on an object does not work.
The Glyph of Warding spell can be cast on either an object or an area. For the object version, only "opening the warded object" is mentioned as a valid trigger. As the question points out, being hit by an arrow or a sword is definitely not the same thing as trying to open an object (heck, the object is trying to open you)!
The area version is less clear, but I think it works at least somewhat.
The Arcane Archer's Imbue Arrow ability, fortunately for would be Glyph-cheese-practitioners, isn't using the object-targeting version of the spell. As a matter of fact, the ability specifically requires that it be used with an area spell, and then casts that spell with its area centered wherever the arrow lands.
Here's the relevant text concerning what can trigger a Glyph:
This powerful inscription harms those who enter, pass, or open the warded area or object. A glyph of warding can guard a bridge or passage, ward a portal, trap a chest or box, and so on.
You set the conditions of the ward. Typically, any creature entering the warded area or opening the warded object without speaking a password (which you set when casting the spell) is subject to the magic it stores. Alternatively or in addition to a password trigger, glyphs can be set according to physical characteristics (such as height or weight) or creature type, subtype, or kind. Glyphs can also be set with respect to good, evil, law, or chaos, or to pass those of your religion. They cannot be set according to class, Hit Dice, or level.
I see two possible interpretations here:
- If "You set the conditions of the ward" means that you can have it trigger off of something other than someone trying to enter the warded area, then you can simply set the ward to the creature type of whatever you're shooting at, and it will go off as soon as it lands.
- If that sentence only refers to replacing the password portion of the trigger, then the Glyph won't go off immediately, but will trigger as soon as the target takes any amount of movement, since I would say moving inside the area of a Glyph of Warding constitutes "passing" the ward.
I favor the first interpretation here, because "you set the conditions of the ward" reads like a blanket statement to me, and because it's less clunky to use, but I could definitely see a DM going either way on this.