Dont think you can do that in a good way with the sine behavior.
What you want is: On collission with platform/walls: move in a total other way then the sine behavior dictates.
Conclusion sine is not suitable to continue the new movement, can as well dig sine all thogeter.
Why not use the bullet behavior ? Let it bounce. Or give it a new direction 'on collission' ?
You cant let it go left and right based on the 'distance traveld'. Or change its direction when it overlaps invisible boundary objects.