OK, I will call it.
First thing I did was point the aircraft at a good field, and then methodically went through the checks. When I switched from both to left on the mags the engine suddenly went back to normal operation, so I flew back to my home airport which was about 15 miles away, arranging my flight path to keep within good gliding distance of suitable areas for a forced approach. I them flew a PFL pattern over the airport to an uneventful landing
Turned out a gear inside the right mag had failed advancing the spark 40 deg. The 2 mags were now fighting each other which totally discombobulated the engine switching off the bad mag corrected the situation
I have some other scenarios if there is interest from the readers of this forum, otherwise I will cut it off here
Cheers
BPF