This is what i would do (if i have understand you correctly):
[Statedef xxxx]; this is the helper appearing from the player1
type = A
movetype = A
physics = N
sprpriority = 3
anim = xxxx; the fireball
[State xxxx, VELX]
type = VelSet
trigger1 = TIME = 0
x = 5 ; the velocity you want
[State xxxx, nopush]; i think you dont want it to be push...
type = playerpush
trigger1 = 1
value = 0
[state xxxxx, HO] ; if you want the fireball to be hit
type = HitOverRide
trigger1 = Time = 0
time = -1
attr = SCA, NA, NP, NT, SA, ST, SP, HA, HT, HP
slot = 0
stateno = XXXX; state vanishing or exploding
ignorehitpause= 1
[State xxxx, ]; change to the new helper in the edge of the screen
type = ChangeState
trigger1 = frontedgebodydist <= 0
value = xxxx ; the state of the new helper
;--------------------------------------------------
[Statedef xxxxxx] ; new helper in the edge
type = A
movetype = A
physics = N
sprpriority = 3
anim = xxxx ; whatever...
[State xxxx, turn]
type = turn
trigger1 = anim = xxxx
trigger1 = animtime = 0
[State xxxx, VELINI]
type = VelSet
trigger1 = TIME = 0
x = 0
[State xxxx, nopush]
type = playerpush
trigger1 = 1
value = 0
[State xxxxx, 2] ; the hit or whatever you want
type = HitDef
trigger1 = 1
attr = S, NA
animtype = light
damage = 50,5
getpower = 50
hitflag = MA
guardflag = MA
priority = 5, Hit
pausetime = 0,0
sparkno = S920
guard.sparkno = S900
sparkxy = ceil(-8*const(size.xscale)), ceil(-30*const(size.yscale))
hitsound = S2,0
guardsound = S3,0
ground.type = high
ground.slidetime = 16
ground.hittime = 16
ground.velocity = ifelse(p2movetype=H, -2, -6),ifelse(p2movetype=H, -5, 0)
airguard.velocity = -4,-3
air.velocity = -4,-5
fall = 0
air.fall = 1
persistent = 0
[state xxxx, 0] ; if you want to make possible to hit it
type = HitOverRide
trigger1 = Time = 0
time = -1
attr = SCA, NA, NP, NT, SA, ST, SP, HA, HT, HP
slot = 0
stateno = xxxxx
ignorehitpause= 1
[State xxxxx, 3]; go or something
type = ChangeState ; or destroyself
trigger1 = animtime = xxxx
value = xxxxx
Adding the screenbound if is necessary in every state or in statedef -2
Then you can call a new helper in that last state, with an invisible anim, give it a high x speed and make it stop when p2bodydist x<=0.
At this moment, hit the p2 and spawn the cage right there.