A lot of good points have been made already, here are some suggestions:
If you haven't already, get some basic music theory nailed down. Just simple things like being able to recognise a subtle key change, a scale or particular harmony. If you're listening to a song and hear something slightly unusual, try googling it to find out, musically, what was actually going on in that bit. There's a surprising amount of information available on this, I'd recommend songfacts.com.
A good writer needs to read a lot, so a good songwriter needs to listen to lots of music. Try to expand your musical horizons to styles you maybe haven't looked at before. You don't have to do a hardcore analysis on each style, just understand the basic gist of the music (i.e. time signature, harmonies, chords). Experiment with folk, blues, classical, jazz, techno - anything really, the world is your lobster. If you want a good place to start, look up the influences of the bands you like and listen to them, then listen to their influences and so on. A lot of the stuff, I believe, can be picked up intuitively.