Events in Gedcom are a bit complicated in that several scenario's are possible.
They are mapped differently to Gramps events.
As support to some programs, the normal text is also parsed to see if it contains married and such, so as to be able to correctly import from those programs.
To fully understand the interplay if you want to dump access data to Gedcom for correct import, you should indeed have a look at the code in plugins/lib/libgedcom.py.
Method __family_even and map event_parse_tbl.
You see like that that if there is no TYPE ident, then type in gramps follows from the line.data after
So, Gramps determines if an event in GEDCOM maps to an internal event type of Gramps (the ones in the drop down list in an empty family tree), or to a custom event type in Gramps.
When it is determined it is an internal one, any text on the Gedcom line goes to the description. Otherwise the text is used to determine the type.
The relationship type in the family is determined from the parsed events in the family record. This keeps overwriting the previously set relationship type, so you must make sure the last event is the one you want. Relationship type only is set on predefined type MARR depending on the description given with the MARR type. The if structure is:
if event.type == gen.lib.EventType.MARRIAGE:
descr = event.get_description()
if descr == "Civil Union":
elif descr == "Unmarried":
Note the capitalization. This corresponds somewhat to http://homepages.rootsweb.ancestry.com/~pmcbride/gedcom/55gcch2.htm#EVENT_DESCRIPTOR
Yes, this seems a bit strange to me, but it is how I see import of GEDCOM works.
So you would need in gedcom (I think)
2 TYPE "Unmarried"