There are different types of immobilizer systems, but the one used in the 3rd gen Yaris (and likely the 2nd gen, but I would have to see the workshop manual) and Scion/Corolla iM (and likely the regular Corolla) is centered around a Transponder ECU. This central hub is connected to the Transponder Key Coil at the ignition where the key is entered and detects the key ID. If a valid key is detected, the Transponder ECU then communicates with the main engine ECM that it OK to start the vehicle. From the bit of legwork that I've done, it seems that Toyota/Lexus use this system in most (all?) of the modern cars - older Toyotas and of course other manufacturers may use different systems or the same style system but using a different communication protocol.
Using the Electrical Wiring Diagrams (EWDs), aka System Circuit Diagrams, is the easiest way to see how the system is setup, and is how we check that the wiring will match - or what wires need to be modified if they don't match. For all wiring comparisons that I do I pull each up and side-by-side; left side is what I have, and right side is where I'm going. It's not an infallible system, especially when you end up with dozens of EWDs open, but it generally works. I've put an example below of the EWDs for the Yaris Hatchback (left) and Scion iM (right).
Picture not included in this copy In doing our engine swap, we have all the components on the Yaris up to the point where the Transponder ECU is connected to the ECM - we know those components work together. The next step is to verify that the wiring and communication protocols between the Tansponder ECU and the ECM match.
Luckily, in this swap the wire terminals from IMI and IMO on the ECM connectors correspond, so we have no wiring changes to make. If you did need to modify the wire terminals on the ECM connector use the last pages of the EWD to match - don't forget to verify the size of terminals as well; that can bite you!
What is not shown is how the Transponder ECU communicates with the ECM. I can't post the whole workshop manual section, but recommend having a read through the section ('Theft Deterrent' or 'Wireless Door Lock' or similarly named chapter found under the 'Interior' section in Toyota manuals) and determining how the signals are sent back and forth; you're looking for waveforms for EFII and EFIO. In this case both systems use the same communication protocol (signal) to communicate, so they should be able to talk.
Given the system components, wiring, and communication protocols match we should be able to make them talk to one another. The part not shown here is that each component has a unique ID, and each ID must be valid to work in the chain of components. Setting the ID is the next post.
1 attachment not included in this copy