On the web, there is an awesome site called Sequencing Tips by John Bloise. Also, the essay Add Realism to Your Synthesized Sequences by Ethan Winer is a very good introduction to giving your midi files the gift of realism. Here are some general guidelines about these two areas. Simple repetition of a neat riff or melody is boring. Likewise, directionless meandering will lose the listener.
Structure guides the listener to see how each portion of a piece relates to the whole.
One way to give a piece of music structure is to have the music tell a story. Each section of the piece can describe a different scene. The music can later return back to an earlier scene, but the second time around should show it in a different light than the first showing. This is a very basic component of music. A melody should sing.