Firstly, I would like to thank everyone for their quick responses!
What i've gathered so far from everyones posts is that I should check all the ground points for solid connection so I've gone ahead and printed out a ground schematic from the Hyundai online service manual among a few other things such as ECU wiring, crankshaft position sensor, and others and took them to my mechanic. I have an appointment to go in a help him work on it this saturday so I will definetly be going over all the things you guys listed. I will keep the thread updated with my progress till I solve the problem so thanks again!
And anyone else who has an ideas they would like to contribute feel free because I know how complex electrical problems can be.
EDIT: The replacement engine was purchased from an online salvage company.