If we're getting into the nitty gritty of the 5e game mechanics, there's a wider issue in that the RAW rules don't actually allow you to "raise yourself from the dead"
- Glyph of Warding (Spell Glyph) requires the stored spell to target "a creature or an area" and "dead body" is neither, it's an object.
- Contingency requires the stored spell to have a casting time of 1 action.
You could probably arrange something like this with wish or stuff that's outside of RAW, but at the point that you're using "rule of cool" you can basically make anything workable and it's all GM fiat anyway. (This is fine, but if your table plays like this, then you're probably not overly concerned with mechanics.)
However... with regards to the point here: Spells in 5e that create undead (such as animate dead) don't usually require concentration - so "I lost concentration" would kind of be fine - you just need to ensure you have the slot each morning to "maintain" the enchantment, (but this is when slots regenerate, so long as you rest you'll be okay)
The bigger problem would be anti-magic fields or dispel magic.