I would look more towards the stupid safety thing that wont let you put it into drive without your foot on the brakes?
A bad shifter cable should probably start to affect the position of drive, reverse, etc.... If it goes from drive to reverse and back again without any problems I would probably look there first, maybe its not "unlocking" right.
Also, is this when parked on flat ground, or when parked on inclines that it happens?