Again, I'm asking this as a non-performer wishing to humanize my midi files. The obvious way, the one that I can think of, is to modulate the dynamics in a sort of wave-like motion that doesn't exactly coincide with the measures (assuming, for simplicity, one iteration of the ostinato pattern per measure). I've done this, and the result already sounds way better, i.e., more human-like. But the rhythm still seems a bit dead to me. Any tips much appreciated.
I think the trick to making this bass part interesting would be to add more expression. Consider the following options to make the music more natural.
You could slightly alter the length of the notes and rests, start earlier/later than exactly on the beat (lazy/forward), deviate from the exact BMP by occasionally slowing down slightly (for example as you would while reading a large piece of text). On top of that I suggest to vary the volume slightly.
No piece of music performed by a person has exactly the indicated length, tempo, volume on each note for the full duration, not even when strictly playing the notes and instructions of the sheet music. There will be natural variances either on purpose (expression) or because we are not, well, machines.
Actually I don't see this as a big problem.
The responsibility for effect of the whole ensemble lies here at the melody voices and the composer typically took care of providing variation there. On the other hand clearly danger exists of overdoing on the side of the piano player - some are already challenged by their minor importance playing just a continuo and any obtrusive attempt might spoil the intended balance.
Similar to @MeanGreen's answer, my first thought would be to place accents (slight increases in pressure / velocity) on certain beats in a rhythmic pattern, for example, in a 4/4 piece with an 8th-note ostinato:
x x | 1 + 2 + 3 + 4 + |
x x x | 1 + 2 + 3 + 4 + |
depending on the effect you are going for.