I can confirm that using rock to increase the mass of a station works well enough.
I was able to determine that my stations drift because NPC ships sometimes crash into them, and sometimes the get stuck trying to fly but unable to avoid one of my stations, so they end up pushing the station hundreds of kilometers.
Yesterday I found and NPC ship doing this to one of the stations that I had added rock to, and I found that instead of pushing the station at a speed of 150m/s as before, it was pushing it at a speed of 45m/s. This made it a lot easier to catch the problem before the station got really far away. After getting rid of the NPC ship, I added more rock to the station, so now it will be even more difficult to push.
So, if you are reading this because your stations are getting pushed around, follow this advice: add lots of rock to it! Rock is cheap and heavy, so it works very well to add weight to a station that you don't want moved.