I believe the achievement is for 500 m in one direction, so don't count the sidesteps (If you do have any turns in your line\0. Also, I'd go over the 500 by a few blocks. I think it depends on your starting mechanism as to whether or not it will count as travel towards the achievement. I know I built one line at exactly 500 m and people weren't getting the achievement on it until I lengthened it a little. Cheapest way is to have a friend stoke a furnace cart to push you rather than making up a bunch of power rails.
Yes, one direction. I think the logic for it just looks at the change in X and the change in Z during a continuous rail trip. If one of those deltas >= 500, you get the achievement. This means that the track doesn't have to be perfectly straight. As long as X or Z changes by at least 500 from your starting point, you'll get it.
How many blocks is 500m