I built a simple Morse Code program - in need of optimisation

Bene:
And what exactly do you mean with maintainability?

Generally, a structure that makes it easy to find and correct problems, and add new features.