To make sure a teleport goes behind P2 while they are at the edge of the screen you can use a helper to push P2
Here is an example from my Piccolo
;----------------------------------------
;Push P2
[Statedef 1546]
type = S
physics = S
movetype = I
anim = 1542
[State 0, VelSet]
type = VelSet
trigger1 = !Time
x = -20
[State 0, PosAdd]
type = PosAdd
trigger1 = root, anim=1801
trigger1 = enemy,BackEdgeBodyDist <=80
x = enemy, Pos X -30
[State 0, NotHitBy]
type = NotHitBy
trigger1 = 1
value = SCA,NA,SA,HA,NP,SP,HP,NT,ST,HT
time = 1
[State 0, Width]
type = Width
trigger1 = Time < 2
player = 100,100
[State 0, PlayerPush]
type = PlayerPush
trigger1 = Time < 6
value = 1
[State 1500]
type = DestroySelf
trigger1 = !AnimTime
trigger2 = root, anim=1801
trigger2 = enemy,BackEdgeBodyDist >80