Early carbureted engines (MGA and early MGB) continue fuel feed after ignition is switched off. Cause of run-on is hot spots in the combustion chamber. This hot chamber condition can be aggrevated by ignition being either a little early or a lot late. But even with timing spot on some engines will run on anyway. Any time the cylinder head is off you should take the opportunuty with a hand grinder to remove all sharp corners in the combustion chambers.
Later production MGB (with fuel vapor absorption cannisters) have an anti-run-on valve. This device will draw a vacuum on the carburetor float chamber to stop any fuel flow to the main jet when ignition is switched off. It works so well thet it will kill the engine immediately even if the ignition spark was still present. It is not a particularly easy retrofit for the MGA.
My expedient solution to this problem is, step on brake, clutch down, select 3rd gear, and let the clutch up as you switch off. It works perfectly every time, and no more run-on.