should I edit 1099-R or file 1040-X later?
Delete the 1099-R. You have to enter the traditional IRA contribution first, then enter the 1099-R so it can match up the already taxed money.
You do not want to file an amended return when this can be fixed now.