I can't tell you what app you were using on your iPhone 4, but I can tell you how you can still play music on your new iPhone using a sleep timer.
To do what you want, follow this process:
- Launch the Clock app
- Tap on the Timer option at bottom right
- Set the timer to 30 min
- Tap on the When Timer Ends option
- Now swipe up until you see the Stop Playing option at the very bottom and select it
- Tap on Set at top right
Now you can use the Music app (and most 3rd party music apps as well) to listen to your music and your iPhone will stop playing it 30 minutes later.
So, the reason for your confusion (understandably so in my opinion), is that Apple’s implementation of this is OS wide, not as a specific function of the Music app.
The advantage of this is you can use the feature with 3rd party apps like Spotify, but IMHO it would have also been good to have the option within the Music app itself. If you feel that way too, you can submit feedback to Apple.