Hi Tobias,
I think a way to start on this path would be to work with two-part canons.
For this application your loop would play back only once (zero feedback) and would play back transposed. (With canon, the imitation can be at any interval.)
If you maintain rhythmic independence of the voices then you can get a Bach-like outcome. That is when your loop has long note-values, you play short note-values. Also go after contrary motion -- the whole trick to all this is to maintain the independence of the voices.
With audio looping, there isn't any great way to do inversion -- however you can do augmentation and diminution (i.e., playing the loop back at double or half speed).
Since you have an interest in Bach Counterpoint, you may want to take look at the Bach Trio Sonatas and also The Musical Offering. Not fugues per se, however incredible studies in imitation and canon that might be more directly applicable to looping.
Another source of inspiration along these lines is Moondog. Moondog wrote rounds however they are so brilliant that you forget that they are rounds.
As far as a full-blown four-voice fugue... it becomes difficult because of the episodes and other "free counterpoint" sections. The imitation in a fugue is not as strict as is a canon. Loops tend to lend themselves to strict imitation.
One approach would be to NOT pitch-shift -- rather, just build up a fugal exposition a track at a time.
Anyway, hope these ideas are helpful.
-- Kevin