Is this what you are trying to do?
exdf= data.frame(ppiedu2=c(1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 5, NA, 5, NA, 5, 1, NA, 1, 6, 5),
education=c(5, 5, 5, 7, 6, 6, 5, 5, 7, 5, 5, 6, 5, 5, 5, 5, 6, 5, 5, 1),
ppi_mm_educ=c(6, 7, 6, 5, 5, 5, 1, 5, 6, 12, 13, NA, NA, 6, 12, 5, 12, 12, 3, 4))
exdf$ppiedu2 <- ifelse(exdf$ppi_mm_educ == 12, exdf$education, exdf$ppiedu2)