MAF or TPS
friend of mine had an issue very similar, sometimes it was fine, sometimes it wasnt.... finally he took it to a toyota guy, and the guy said somehow some wires were pinched with the MAF, he cut them and soldered them back together... no more problem
was it possible some harness is not connected or loose, or wires damaged when doing your swap?