File: CvDLLButtonPopup.cpp
Methods, in this order:
1. launchButtonPopup
2. launchRazeCityPopup
3. OnOkClicked
(button popup type is BUTTONPOPUP_RAZECITY all that time)
But that's unlikely to help you much (as you say, the freeze isn't connected to the human popup as it happens on autoplay as well; it's more likely happening in CvCity.cpp or CvPlayer.cpp). What you need to do is compile a debug DLL and attach the debugger. Then when the freeze happens you select Debugger->Break in Visual Studio and check the Call stack. You'll know exactly what happens, function by function. You can track back, or go forward, step by step.
If that doesn't work (i.e. it lands you in the assembly) you can insert a breakpoint in launchButtonPopup method and go step by step from there. Obviously you'll want to do this with a save where this happens 100% of the time.
Here's a
tutorial by Asaf that includes a section on Debugging; it gives more details on things I mentioned, if needed.