CAN BUS Menu System - Timing of replaying messages/Code Issue

Hi all,

For my project I have been using a CAN BUS Shield to sniff messages on the CAN BUS of a car, and then replay the messages. I have several messages that I want to send back to the car, and have implemented a menu system.
However when I choose an option to send back to the car, It will only work for a split second. I want the message to continue until I choose a different option. The messages worked individually before I put them all in the menu system and the main loop. Is it because they are all in the main loop together that it wont work as I want?

Here is my code:

.edit

Any thoughts or input appreciated!

So take everything out of the while loop.

So I just need to delete the "while(Serial.available()" and the associated curly brackets and all should be good ?

I have a feeling this will lead to loads of errors ?

char UserInput; //global

if(Serial.available())
{
  UserInput = Serial.read();
}

//rest of code here

Much appreciated. Thank you