Moved to Completely Unrelated as this has nothing to do with Final Fantasy.
How song looping is handled really depends on the game. Loop points could be stored in the song file itself, or in a config file somewhere... but since it was looping before and stopped once you replaced the music, I'm gonna assume it's probably the former.
What filetype are the songs?