Well, you've got two toplevel options
- Develop your own playlist functionality - store a list of songs, manage their order, play the next one when a song completes
- Work with actual spotify playlists
Option 2 is generally better, as the user will be able to leave your app and still listen to songs.
In the case of option 2, you'd need to register for the Playlist's changed event, scan for the location of Song A, and move Song B after it. I don't think there is currently a way for it to be super efficient.