So when you turn the ignition switch "off", the engine runs-on, like "k-knock, K-NOCK-KNOCK-KNOCK, sputter, swoosh? If so, what's happening is combustion is taking place after ignition ceases at the spark plug (gap). You can have such if there are "hot spots" in the combustion chamber, such as excessive carbon buildup, possibly combined with a larger than spec throttle opening or vacuum leaks, which would allow off-idle amounts of air to enter the engine, even though you're not on the throttle.
To answer your question, a higher octane fuel would, if anything, have no or a marginal effect on what's going on.
If any of this makes sense, you might want to discuss with your mechanic.
14 Serentiy 28' "Built by British Leyland"
74 IH 100 Travelall Custom "Sal"
75 IH 200 Pickup 4x4 "Hal"