can control up to 6 servos (by PWM) without problem
No, you can't. Servos are not controlled using PWM. They are controlled using PPM.
I have a Mega Arduino, I know that you can control up to 48 servos, but do not know
how to make an optimal code for that
Optimal code depends on what you want to do. Arrays will almost certainly come into play.
But he liked to take it more simply, get a string with 30
identifiers over the respective values of position
He who? If you want speed, you almost certainly don't want a string of anything. An array of bytes, now, that's a different story.
What kind of servos are you using? The standard 0 to 180 type? If so, you can send a start of data marker (a byte whose value is greater than 180, and less than 255), the 30 serial positions, and and end of data marker (a byte whose value is greater than 180, and less than 255, and different from the start marker).
On the Arduino, read the data from the serial port, discarding data until the start marker arrives. Keep reading, storing and counting the values until the end marker arrives. If you received 30 values, use them. If not, the packet was corrupt, and should be discarded.