Many things come to mind - timing is not amongst them.
First - what rpm is it running at when you switch it off - if it's at high rpm, it may do that.
Second - what carb are you using (and where are you)? Stock carb should have an "anti-diesel" solenoid that cuts the fuel through the idle circuit when the ignition power goes off - of course, this has little effect it it's not at idle (see #1 above)
Third - excessive carbon build up in the chambers can cause hotspots which ignite the fuel air mixture without a spark, but, if the throttle is closed and it's the stock carb, the anti-diesel solenoid cuts the fuel and the engine dies (see #1 & #2 above).
Was doing the same too me to, found out it was a fuel problem always was doing it when i put 91 in it but when i use 98 unleaded shuts off straight away guessing its just the carbon on the pistons that is still lighting the fuel when you shut it off and the 98 unleaded does not leave that much carbon on the pistons?