do your brake lights both work (frnt/rear)? horn work?
if any of the bulbs were replaced with the wrong bulb it will not idle right. it needs the resistance factor that runs throught the brakelight coil return, some had the ground circuit running through the same wire as the horn ground. it really depended on what wiring harness was on hand at the time, sachs made so many engines for other manufacturers it is hard at times to difinitively give a yes or no answer, it is often more of a multiple choice with an essay question.
if you re-routed the grn/blk wire to ground. you need to bypass both sensors and run everything off the yellow wire to bypass the safety circuit.
the sparta dia. has alot of info that directly applies to a 505 even tho its a 504.