Yep... it's in those wires in your red circle. Since that is the actual kill wire, at the coils... when you turn your key off... it's not going to shut down clean. It's going to stumble, and take a few seconds to shut down as the fuel injection bleeds down. Basically... it has to run out of fuel.
There's no sensor, or other outside part that will "Kill" the engine. The ECU can put it into limp mode... but it will continue to run. Things that can kill the engine are...
1) Bad Throttle Gaurdin
2) Bad Stator
3) Bad Trigger
4) Chaffed wires
5) Bad key switch
6) Bad Safety Lanyard post
7) Bad coil packs (they don't normally kill the engine. just kill spark from their bank)
8) Bad Rev-limiter.
As you see... there's a bunch that can kill the engine... so pulling the wire at the coils will potentially eliminate a bunch of things. If it still does what you are describing... an you still think it's electrical... then you will need to pull the flywheel.
Last thing... take a pressure gauge with you to the dock, and check the fuel pressure too. May as well look at that.