I wrote that sketch that you have included.
To do what you want you need to think of your problem in small pieces.
You need some code to receive characters from the PC. I wrote another demo here which might help with that).
You need some code to choose what happens for each different character. You can use a series of IF statements of a SWITCH statement followed by a series of CASE statements. Look up IF and SWITCH/CASE in the Arduino online reference.
You need a piece of code that makes stepper motor A move X steps in the appropriate direction. The basics for this are in the code you have already posted.
I would start by writing three small sketches, one for each task, so that you can learn without being confused with unnecessary complexity.
I am assuming you only want the motors to move in response to a character being received and more complicated timing of moves is not needed. But that could be incorporated if necessary.
...R