Every artist experiences those moments. You know, the ones you never get on tape when you're home alone at 3AM and everyone in a 15 mile radius is sleeping.
Don't be discouraged. These are the moments when songs are born. I find that I normally generate between 3 and 5 really good riffs, at least riffs I think I might still like a few days later. Once I start to come out of my "zone" I have to play each riff about 10,000 times before it finally settles into a song. This process, at least for me, can take months. You are only going to get so far with your song the first day. Take it that far, make sure you have it locked in memory - then walk away. Go play some Bond, eat some cheetos or just go to sleep.
You have to build each song a little bit at a time, and the best time to do it is when you feel that spark. You may try to tack on a riff here or there when you're just bored and want to mess around on your guitar, but you will only do your highest quality writing when you hit the zone.
Songs are like children, you have to give them freedom to grow. I used to write things that I abandoned because "they weren't my style," in other words friends of mine might think they were "gay" or something.
Forget that. What you write is your style. Whether you call yourself a punk, emo-reggae, cyberfunk hip-hop goth or whatever, you may still pump out a fantastic country and western yarn. And why not?! Don't knock it if it's good.
That's the best advice in this whole article - don't knock it if it's good. Forget your "image," forget your pretense - this is your song, and to Hell with everyone who denies you the freedom of expression.
Songs are also not like children in that you build them a full-sized skeleton first, then fill in the guts and blood and skin and things later. I suggest starting with a few basic riffs, and only a rough sense of which ones will come first, second, last, which ones feel "versey" vs. "chorusy" and so on. Don't try to instill too much order in your piece. Order will fall into place, concentrate on the ideas at hand.
You also want to generate more ideas than you will need. Start with too much, then trim. Your song will sound better if you create it in this manner rather than starting with too little and trying to add things later. Whatever you add will never fit as well as things that were already there. That's not to say you can't add ideas later, but I suggest only seriously adding a riff if you know it fits - don't force it just to "finish" writing.
That's another thing. Real songs are never finished. What bands do you tire of hearing? Bands who sound like the record. The record is forced to be perfect - it is an illusion. The band then goes out on tour in an attempt to recreate that illusion. This never lasts because, ultimately, the illusion is boring. It doesn't develop - it doesn't have a soul.
Artists who last - BB King is a perfect example - never stop writing. Sure, certain songs settle into a certain groove, but it's always full of life, always vital. Your song is a living thing. Let it breath and grow and run wild - you will be a happier parent.