Immediate stroke/seizure Therapy
Yes, these devices and treatment programs are being actively developed. General idea is that epileptic episode follows certain path within the brain. It can start in thalamus, after which sporadic activity spreads into cortical areas, for example motor cortex. There is a number of papers on prediction of epileptic seizure, e.g. Seizure Prediction and its Applications.

The device then will detect initiation of seizure before evident symptoms and provide inhibition via cortical electrodes, microelectrode array (MEA). It seems that currently MEAs are used more for research (recording from tens of neurons), but single electrodes are useful for actual control of epilepsy. Also one can control vagus nerve, which causes parasympathetic response (general inhibition, aka "rest-and-digest"). More you can read here.

Transcranial magnetic stimulation, as I understand, is not portable enough to be useful.