If you get a midi loop there’s still something wrong with your "environment" configuration in Logic. Never route the output from Octopus to the Logic-track that represents Octopus again. There’s your midi loop.
Instead use 2 different scenario’s, one for recording and one for monitoring. You can use a "switch" (Logic object) for switching between:
a. Recording. The track object is connected to all kind of synths BUT NOT Octopus. Route your Octopus (Logic) input to the "Recording & Thru" object.
b. Monitoring. Route your Octopus (Logic) input directly from "Physical Inputs" to your synth objects.
The switch can be used when strategic placed between "Physical Input" and "Recording & Thru".
Used this scenario many times when I was working with more computers (soft sequencer stuff) or other midi generating gear.