As chip has said, its perfectly do able to fit the engine, but be aware you will need a lot mors than just the engine, as you will need to upgrade the suspension and brakes to cope, and bearing in mind a 172 can be had for 1000 pounds +, it would end up costing you more than that to get t up to 172 'spec' and then due to it being modified it will cost more to insure than a 172 too.
Years ago, It was financially beneficial to do the engine swap as the cars were fetching thousands but nowadays it's financial suicide to do a conversion on a non RS imo