Make sure the output shaft threads are in good nick. A loose nut can wreck them.
If the output shaft threads are focced then you have a big problem, you are either looking at replacing the output shaft, which is a bit of a job, getting another engine or welding the sprocket to the output shaft which just delays the previous two options for the life of the welded on sprocket.
If there is just mild damage to the thread you can just clean it up with a file thread and fit a new nut.
But hopefully you've found it in time and don't have any such damage.
This is the kind of mess I'm talking about - my old 600 (it's the early 600 that is generally plagued by these issues)
You can clearly see the thread is stuffed in this photo. I welded on a sprocket, rode about for a while and traded it in for a new thou.