Havent tested it but try something like this
"direction" global number variable at 0
'On collision sprite with the player ' Event
'add one to direction' action
'direction is greater than 0' event
'every (speed) seconds' event speed meaning lower decimal higher speed
'simulate platform left' action
'direction is greater than 1' event
'every (speed) seconds' event
'simulate platform right' action
'set direction variable to 0' action