Hey there all, I have a problem that has been giving me a lot trouble. Hopefully yall can give me some advice.

I have a 97 grand prix gtp with a little over 200,000 on it. I know just breaking it in lol. Well I went to change the front valve cover gasket and as I was taking the coil bracket off I accidently made a spark, did not disconect the battery. Did not think anything of it but when I went to go start it took a few cranks to get it started. Ever since then it has trouble starting. I took it to a mechanis and he said that it was the crank position sensor. He hooked up the scanner. I replaced it before I took it to him and he said it could be the connection or the wiring? I looked at the connection and cleaned it out and it looks good but still no luck. It still is hard to start but once it starts it seems to ok. It has turned off on me a couple of time. Is there a certain way to install the crankshaft position sensor? What else can it be? I replaced fuel filter, plugs and wires, ignition control module. Autozone gave me a code of P0300? Any help would be great.