You can calculate the speed from the xy velocities with:
Speed=distance(0,0,sprite.physics.velocityx,sprite.physics.velocityy)
Then you can make a condition to check is speed>maxspeed, and if it is then set the velocity to
sprite.physics.velocityx*maxspeed/speed ,sprite.physics.velocityy*maxspeed/speed