Vasoconstriction is generally the culprit, often alongside some psychological torment which is really easy to get into with meth. There isn't really anything safe which can be suggested here specifically for this issue. People have taken ED drugs, but it's with a major cardiovascular risk. A constrictor alongside a dialator isn't a good mix. Almost speedball type logic. It can cause some bad reactions.
A bit of Xanax isn't going to do anything too badly, and would probably at least take the edge off of any anxiety and racing heart. Don't take too much. I don't know if it can really help with stim dick but it might help you relax so that part of it isn't an issue. Mind over matter is traditionally the root cause of most ED issues.