Praise be to Allah.
It is unwise and is not a means of healing to regard your illness with such certainty, as if you are sure that the jinn or the shaytaan are the cause of the seizures that you experience and you regard possession as being the real cause of your illness.
First of all, we advise you to realise that possession – even though it is something that does happen to people – is something rare, as has been determined by experts. Usually what happens to some sick people of seizures or psychosis is due to psychological problems resulting from social circumstances or an individual’s personal situation, or because of physical causes resulting from hormonal imbalances in the body. Some of these hormonal secretions are responsible for causing seizures or may appear in the body as symptoms similar to the symptoms of possession, when in fact they are imbalances which require medicine to regulate them and restore their natural balance.
Shaykh ‘Abdullah at-Tayyaar and Shaykh Saami al-Mubaarak said:
Symptoms of possession, witchcraft and the evil eye may, in some cases, be similar to symptoms of mental illness or physical illness. For example, one of the symptoms of possession is anxiety, but is every anxious person possessed? A person’s psychological state may cause anxiety in many cases, and turning away from the Most Merciful may also cause anxiety. Allah, may He be exalted, says (interpretation of the meaning): “But whosoever turns away from My Reminder (i.e. neither believes in this Quran nor acts on its orders, etc.) verily, for him is a life of hardship, and We shall raise him up blind on the Day of Resurrection” [Ta-Ha 20:124]. Epilepsy may also be caused by possession, or it may be due to physical causes.
End quote from Fath al-Haqq al-Mubeen fi ‘Ilaaj as-Sara‘ wa as-Sihr wa al-‘Ayn (p. 64)
Hence it is essential to try all kinds of remedies and to consult specialist psychologists who are known for their understanding and trustworthiness, and to seek help in finding the real causes of what you are suffering from, and to look for beneficial treatment to which we ask Allah, may He be exalted, to guide you. Whilst doing that you should also regularly recite the prescribed adhkaar and Qur’anic awraad as much as you can, so that that may be a protection and healing for you, by Allah’s leave. Allah, may He be glorified and exalted, says (interpretation of the meaning): “And We send down from the Quran that which is a healing and a mercy to those who believe” [al-Isra’ 17:82].
With regard to your attending classes and lectures when it is most likely that these seizures will occur:
If what happens to you of seizures and screaming is something minor that can be put up with, or is something that happens infrequently, then we hope that there will be nothing wrong with you attending those classes, especially if this disturbance does not happen during the prayer.
But if the disturbance will be significant and will bother the people around you, and cause them to miss out on the benefits that they are hoping for, then we do not advise you to attend. It was narrated that Abu Sa‘eed al-Khudri (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) observed i‘tikaaf in the mosque, and he heard them reciting out loud. He drew back the curtain and said: “Verily each of you is conversing with his Lord, so do not bother one another, and do not raise your voices over one another in recitation.”
Narrated by Abu Dawood in as-Sunan (1332). An-Nawawi said: Its isnaad is saheeh. End quote from al-Majmoo‘ (3/392); classed as saheeh by al-Albaani in Saheeh al-Jaami‘, no. 1225
If the Prophet (blessings and peace of Allah be upon him) described raising the voice in reading Qur’an and disturbing other worshippers as “bothering”, and forbade it, then it is more apt that the one who raises his voice because of his illness and suffering should also be forbidden. Hence the fuqaha’ stated that anyone who causes a disturbance should not be allowed to enter the mosque, whether that happens of his own accord or otherwise. What matters is that mosques, study circles and dhikr circles should not be exposed to disturbance from people who do these things because they have a genuine reason for that and cannot help it; and they will be rewarded for that, in sha Allah, because adhering to the shar‘i ruling brings a greater reward. Respecting the mosques and study circles takes precedence over achieving a personal interest that can be achieved sooner or later. We hope that Allah will decree healing for you sooner rather than later, because of what He sees of your sincerity and adherence to the shar‘i ruling, and your giving precedence to the sanctity of shar‘i knowledge over your own learning.
But if these seizures only come to you rarely or infrequently, then what happens rarely is not subject to any ruling, and there is nothing wrong with you attending classes and dhikr circles. Perhaps you have a friend who can help you if something happens during the class, thus avoiding causing any disturbance.
For more information, we advise you to read fatwa no. 173064
And Allah knows best.