This function creates a new edge (of EdgeType) to/from the specified node target (depending on outgoing) and adds it to the specified index in the list.