Trying to get a longer tone out of this code

Yes I can help. There is a very easy to use function inside the arduino-IDE to post code in the expected way. It needs only a few mouse-clicks

read this tutorial

best regards Stefan