Welcome to the forum. Sorry you're having problems but that's why we're here. Let's see if we can help.
Your wiring looks correct. Black to black and blue to blue. The two wires from the kill switch (button) might be any color but that doesn't matter. They connect just as you have them.
As for your chain problems, it sounds like your sprockets aren't aligned and the chain tension is not correct. The engine drive sprocket and the rear wheel driven sprocket must be in alignment with each other. The chain must run in a straight line between the two. If you are using the kit supplied tensioner it too must be aligned with the chain centerline. You'll want 1/2" to 3/4" of slack in the chain. Too loose ot too tight will cause problems.
If possible show us a photo of the way your chain and rear sprocket, tensioner if you have one, are installed. Maybe we can offer more help.
Tom