I don't have time to read through all thiis convoluted thread, but if you are opening the Pi port each time to want to send a value it may be resetting the Arduino. This is a "feature " but a right PITA. There is a hardware fix that involves a capacitor on a couple of pins detailed somewhere. I use a Nano to control a pendulum clock and to update some parameters via the USB port i have a switch that connects the cap for control mode or not for reprogramming. One way to check would be to look at the leds on your Arduino as the Pi starts sending to see if you get8 the characteristic reset pattern.