It shouldn't be that hard in all reality. Farmers can plant crops within 1-2" with RTK and I know they can do similar tolerances with construction equipment.
You put two receivers on the car so you can always establish the centerline of the car, live data transmission back to the race stewards, have a GPS map of the track limits, know the offsets of the car width, throw in a 2" margin of error (or similar), some automatic reporting and this issue is taken care of. It's probably a little more involved then that, but it's not like the FIA or F1 is hurting for money.
As far as the track, saw a YouTube video where they brought up the issue is that some of the other series (MotoGP) don't want gravel traps that close. Personally, I think that the arguably best drivers in the world should be able to keep it between the white lines. Don't want a penalty? Don't break the rules.