All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
First of all, we congratulate you on Allaah blessing you to be steadfast in obedience to Him and we ask Him to make you firm and steadfast for the rest of your life. We advise you to seek beneficial knowledge, perform good deeds and befriend righteous and pious people.
Masturbation is forbidden whether you use your hand or anything else to do it; anything that leads to what is forbidden is also forbidden. For more benefit, please refer to Fatwa 83000. Therefore, it is not permissible for you to resort to it without a necessity.
The existence of the blood in testicles is generally due to a disease. If you are sick, you should consult doctors so that they tell you what it is exactly and give you the appropriate medication. There is no disease except that it has a cure as confirmed in the Sunnah. Jaabir narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: "There is a cure for every disease, so when the cure is applied to the disease, the person is cured, Allaah willing." [Muslim]
The Prophet, sallallaahu ‘alayhi wa sallam, ordered us to seek treatment but he forbade us to seek treatment with what is forbidden, as he said: “Seek treatment, but do not seek treatment in what is forbidden.” [Abu Daawood]
The Prophet also said: “Allaah did not put the cure for my people in what he forbade them to do.” Another narration reads: “If a person seeks treatment in what is forbidden, then Allaah does not put a cure for him in it.” Shaykh al-Albaani said in as-Silsilah as-Saheehah: “This Hadeeth is Hasan (good) with all its chains of transmission.”
Allaah Knows best.