So, you had priapism (erect penis for more than 4 hours -- that's an emergency by the way) several months ago and now you can't get erect. Did you not get treatment for the priapism? The longer you let it go if it happens, the greater the chance of a more long term situation. So, impotence has different reasons. Sometimes meds we take can cause it. What meds do you currently take? That can contribute. And a huge reason for impotence is our own mind. Psychological issues can compound the problem. ED drugs do work for impotence. Do you see a urologist? I think that would be a good idea in your situation with your history. Getting you to have an erection again is important and your doctor will take that seriously. So, is seeing one a possibility?
If a doctor gave you the prescription to try, try it. That's their remedy for your situation and you should give it a try. They wouldn't give it to you if they felt it would cause further issues. The one that is cheap, sildenafil, try that and see if it allows you to get an erection again.
It is a side effect occasionally but your doctor doesn't see a reason why it would be one for you personally even based on your history. Two doctors in fact. Just because you had priapism preciously doesn't make you more prone to it so they prescribed it. They have medical training and you don't. So, I'd keep that in mind if you want to solve this issue. good luck