Although this query looks long, it should do what you want efficiently:
MATCH (author:Author)-[r:HAS_WRITTEN]->(article:Article)
DELETE r
WITH article, COLLECT(author) AS authors
DELETE article
WITH authors
UNWIND RANGE(0, SIZE(authors)-2) AS i
WITH authors, i
UNWIND RANGE(i+1, SIZE(authors)-1) AS j
WITH authors[i] AS a1, authors[j] AS a2
CREATE (a1)-[:CO_AUTHOR]->(a2)
It first finds all the HAS_WRITTEN relationships and deletes them. Then it aggregates the authors for each article and deletes the article. And then it creates a CO_AUTHOR relationship between every pair of co-authors (there is no need to check for existing relationships, assuming none of the relationships existed before running the query).
[CORRECTION]
The above query has a flaw, as pointed out in the comments. If the same pair of authors co-author multiple articles, then they would end up being connected by multiple CO-AUTHOR relationships. So, this would be a corrected solution:
MATCH (author:Author)-[r:HAS_WRITTEN]->(article:Article)
DELETE r
WITH article, COLLECT(author) AS authors
DELETE article
WITH authors
UNWIND RANGE(0, SIZE(authors)-2) AS i
WITH authors, i
UNWIND RANGE(i+1, SIZE(authors)-1) AS j
WITH authors[i] AS a1, authors[j] AS a2
MERGE (a1)-[:CO_AUTHOR]-(a2)
It first finds all the HAS_WRITTEN relationships and deletes them. Then it aggregates the authors for each article and deletes the article. And then it uses MERGE with an undirected relationship to ensure there is a single CO_AUTHOR relationship between every pair of co-authors. The UNWIND clauses are used to avoid obvious relationship duplications.