Here's what you need to consider:
* Engine Code: The engine itself might bolt in, but you'll need to verify the engine codes are compatible. Different engines have different accessories (alternator, power steering pump placement, etc.) that might not line up perfectly. Even if the block itself fits, you could have issues with the engine wiring harness, computer, and mounting brackets.
* Transmission Code: The transmission is a similar story. The transmission bellhousing needs to match the engine's, and the transmission mount points might differ. Even if the physical mounting works, the linkage or electronic controls for shifting could be incompatible.
* Computer and Wiring: The engine control unit (ECU) is likely different, and the wiring harnesses might not be directly interchangeable. This is a major hurdle.
In short: You'd need to find the specific engine and transmission codes for *both* the donor Grand Am and the recipient Sunbird. Then, you'd need to consult a parts catalog or a mechanic experienced with these cars to determine compatibility. Simply assuming because they're similar GM cars from the same era is risky. You could end up with a significant amount of modification work, or find the swap simply isn't feasible.