I've written some and I have a few tips.
Ok, so you have your first riff, sometimes the following riffs or the chordprogression comes naturally, but not very often. So there's a few things we have here to help us. Let's say you have a riff in a aeolian, do the exact same riff but in D-dorian, C Ionian etc. Just to get the hang of what positions you can use for your next riff. Play your riff inside out, backwards, chose a new scale like A harmonic minor, play it in E-minor. Just alter the riff theory wise to find new ideas.
Get the chord progression you have and analyze it, what cadences etc. If you're stuck somewhere, try EVERY cadence from that position, just to get a small Idea of what possibilities you have.
Go get a piano and learn what you play, then try to come up with a nice piano part for it, record it and try to play your guitar to your piano piece.
Try painting what you hear, then try to play what you've painted
Come up with beats, try drumming your original riff on your legs and then alter it rythmically while drumming on your legs.
Learn how to sing your riff and harmonize it with your guitar.
These things are things that works for me when I'm stuck with the best riff in the world, but dunno how to proceed.