There are many things that happen inside the code that can be difficult to figure out as one is making the code. The toughest parts would have to be getting the safe start-up and making sure that you do the modification to the entire code the right way. These are the two main concerns because public safety is always a big concern for anything that engineers come up with because it affects everyone around the product that is produced.
Allowing the motor to run, attaching the arduino, and setting the speed would have to be the easiest part of writing the code. There are only a few commands and the speeds are given because the system and only run so fast while also being safe because of the people on the road, pedestrians walking, and the workers on the train itself.