replace thermostat or change motor on 1996 Infiniti I30

my car ran hot and shut itslef off because someone put stop leak in with the coolant. should i replace the thermostat or just replace the motor incase of a blown head gasket?

Asked by for the 1996 Infiniti I30
I can see where it would shut down because of overheating. I don't see where it would shut off because of the stop leak unless it has caused a major clog to coolant flow and that caused the overheat. I would recommend replacing thermostat any time the engine is overheated and then diag for what is needed and go from there.