That code isn't all correct. For starters, you want to use a sprite table which sets the direction in which the platform is moving. This is the index to the acceleration and max speed table. You then use a timer, for how long the platform is not accellerating. Once the timer runs out, you change the platform's direction and set the timer again.
You can take a look at the Checkerplatform Disassembly on how it handles the speed.
You can take a look at the Checkerplatform Disassembly on how it handles the speed.