http://www.mod.uk/NR/rdonlyres/55EDB...ambenefits.pdf
This link tries to explain it in the usual MoD 'we're making out we're explaining it, but being pretty vague so relatives will have to press to test' -style language.
My interpretation is get married before you die and it'll be simpler for the relatives - it doesn't
seem to matter if you married while in the Service.