Hmm, I think this shouln’t be a problem. Just assign your MIDI input and MIDI output to the same track (using the input and source buttons on the track header or mixer strip).
Please write back if this works for you, or if you need more advice!
You should be aware that this setup will create additional latency, though, depending on your audio driver settings…