This is a large subject with many variables.
The generally accepted rule (unwritten rule) is that if you write a song with someone..... no matter how much or how little you contribute to it....as long as you did contribute to it, the split is equal to all the writers....whether it's 2 people or 12 people involved in the actual writing.
On an existing song..... I would say the same agreement should apply because.... if the song has not been published and making money..... who's to say that the small changes the new writer did are not the sole reason it finally got published.... so while the new writer may have done a few what seemed like minor changes.... it could have been those changes that made the big difference.
What you do need to do in this case is:
1. Draw up a written agreement with the original writer(s) and everybody needs to sign it.
2. File an amended copyright (assuming they have done so at this point). The new copyright will reference the original copyright by registration number and will list you as a writer and specify the percentage of ownership.
3. Register the song with a PRO (the publisher will generally do this for you) and specify ownership percentages as writers with the PRO.
Pay: nobody gets paid until the song is signed by a publisher AND released commercially and is making money. Then... you get paid according to the signed agreement as per #1 above..... and the publishing contract you signed with the publisher, and the percentages listed with your PRO for performance royalties.
generally, a writer gets paid from the Publisher and the PRO and that is all. The publisher handles collecting mechanicals and licenses, and may handle performance too..... the PRO specifically handles radio, TV and live performance royalties.
Like I said there are many variables in how all this can be set up. The best advice I can give is to read and research on your own. A book called This Business of Music is a great book to use as reference. It's written by music biz people so it can get a bit deep into this business end ..... but it's a great reference.