It's just my opinion that the tail shake came first, and rattlesnakes ended up with a device on the end to help enhance the rattling of the tail. I base this only on the other point I want to make here....
It's crucial that you keep in mind that evolution isnt the result of a conscious effort on a species part. An animal cant decide to evolve in a certain way. It either has the genes present, or it doesnt. Slight accidental differences are the root factor here, or a misfire of a Hock gene**. If the genes are present, and they get expressed, then that's when the change gets made. So, I think over time, snakes that shook their tails were less likely to get trampled or messed with. This behavior got passed on as part of instinct, like the same instinct that drives animals to eat when they're hungry. Over more time, the American species developed extra stuff on the tails that enhances the sound. Maybe it started as just a more blunt tail because more meat at the end creates more impact on the leaves or whatever. Then the meaty end developed a loose scale over it's tip, which happened to make a little rattling noise, and this was more successful than no noise at all, and thousands of generations later, more and more buttons started to not fall off during a shed.
I think, for a ratsnake to "try" and imitate a rattlesnake to keep it from getting molested sounds a bit wrong to me. A rat snake doesn't know how much better equipped rattlesnakes are 
It's also difficult for some people to truly wrap their heads around how long this kind of thing takes to happen.
**Hock genes are like "boss" genes which have some control over groups of other genes. They provide general sets of instructions for more specific tasked genes. Recently, scientists manipulated a hock gene in a frog to grow a fifth leg where it's eye or ear should have gone. This is a drastic example, but given random chance, every once in a while a minor change will happen which doesnt negatively affect the ability of an animal to survive. Sometimes it's beneficial.

-----
Tom
"The more people I meet, the more I like my snakes"