What I do if I have writers block is just walk away... totally completely... unless I have to get the song finished for some kind of deadline ill just put it on the back burner for about a week.
Ill also cut down listening to any kind of music that resembles the genre of the song I'm writing and put on something totally diametrically opposite to it. Like if im writing power metal, Ill cut down on the amount of power metal I listen to and listen to grindcore, classical music and stuff. It can work the other way too I've found but I tend to find that my ideas are way less original if I listen to the genre im writing for during a songwriting period.
Also, fuck about with tones, samples, different styles of music, etc. A lot of time inspiration will hit me just because I've used a particular snare sample or guitar tone or cab sim or bass synth whatever. Same with samples. Try and come up with something on a different instrument and then port it to guitar and vice versa even.
Also try and think outside the box. Try and move away from 4 blocks of a 2 bar riff and stuff. Try and deliberately write in a different time signature or come up with something with an uneven number of bars. Way too many musicians will just hit 4/4 without thinking about it and there are just as many who write in 7/8 just to try and look cool without even putting any kind of effort into establishing a good rockin' groove. Also dont even worry yourself if you think you're crossing genres. Thats the way forward for metal in my opinion rather than all these little cliques that have rules of what a song must contain.