Flight Crew Commercial; Flight Crew Flight Instructor
Distraction; Confusion; Time Pressure; Troubleshooting
Aircraft Equipment Problem Critical
Flight Crew Overcame Equipment Problem; Flight Crew Returned To Departure Airport; General Maintenance Action
Aircraft
The student had just begun his touch and go at ZZZ and we were on the climb out about to turn left to remain in the pattern. At 600 feet; the engine began to shake and sounded like it could shut down at any minute.  The power sounded like it had dropped by at least 500 RPM and then slowly came back up to around 2500 RPM.  At the first sign of trouble; I took the flight controls from my student and began to turn back towards the airport and ensured that we did have full throttle and the mixture was full rich.  Once I got the airplane up to 1;000 feet; I set up for a tight traffic pattern and landed on Runway XX.  Once we were off the runway; I decided to taxi back to the beginning of the runway and attempt to clean the spark plugs with our recommended fouled spark plug procedure after two attempts to clean the spark plugs the RH mags still dropped 200+ rpm and began to shake the engine and sound as if it was going to shut down.  The decision was made by both my student and I to taxi back to a ramp and shut down the engine.  The aircraft was parked on a ramp and we tried the fouled spark plug procedure again and still the RH mags where dropping by at least 200 RPM and violently shaking the engine. Once the engine was shut down; we stepped out and performed an inspection of the aircraft and noticed some sort of sticky residue seeping up onto the cowling that neither of us had seen prior to our departure from ZZZ1.  There was also a strong aroma of something burning like oil or rubber that could be smelt once you stepped outside and the engine began to make abnormal gargling and popping sounds after we had been outside for a few minutes and did not resemble anything I have heard come from a Cessna 172 in my 200hrs of flying it.  Looking at all of the abnormalities with the engine and determining that I; the PIC; was unfamiliar with the terrain around ZZZ and the remainder of the flight would take place over dark areas until we reached ZZZ1; I did not feel confident in my ability to safely land the aircraft somewhere in the event of an engine failure.  I called the Flight Supervisor on duty and requested the student and myself be flown back to ZZZ1 and the aircraft be looked at by Maintenance.
A Cessna 172 Instructor Pilot reported a rough running engine while conducting training; resulting in a return to the departure airport for a maintenance inspection.