First MRI scans are fiendishly noisy, so it is a little odd that they say you can listen to music - listening depends on being actually able to hear , and I certainly could not during any of mine.
And I certainly did not have a button I could press at any time, so don't rely on that.
Do tell the staff that you are nervous about being in an enclosed space for too long. They will expect that, but as they are not mind readers they won't know unless you mention it.
I found repeating things I know by heart helped to pass the time. If you can't remember screeds of poetry, or the speeches from Shakespeare we learned at school, try the multiplication tables, or nursery rhymes.
I managed at least a whole decade of the Rosary, but if you are not in the habit of praying, that won't help you.