This is almost exactly my approach. For a while, I was working on a web page to share the heuristic I'd worked out for it, but I ultimately figured it wasn't worth the time. Since it's relevant to this thread, here's my heuristic:

1. Are you driving faster than the speed limit? Coast. If not …
2. Can you see more brake lights (that is, cars with brake lights on) ahead of you than the number of lanes traveling in your direction? Coast. If there are more lanes than cars with brake lights …
3. Is the buffer between your car and the car in front of you getting smaller / staying the same? Coast. If the distance is getting larger, you can accelerate.

So, essentially, the only time you get to accelerate is when you're below the speed limit, there aren't many cars braking in front of you (in any lane), and the gap in front of you is getting larger.

And here (below this) was the copy I'd worked up for the page. I was calling the approach "coasty," and was applying some game design theory to it, so if there are any "game" references in the copy below, that's what they're referencing.

========

The goal of Coasty is to consume less gas, to drive more safely, to get to your destination in about the same amount of time as you would otherwise, and to have more fun while driving.

Consume Less Gas:

Almost every time you brake, you’re wasting gas. You had to use gas to accelerate your vehicle, and you’re now intentionally slowing the car down. You’ll then need to accelerate again, to get back up to speed. You're doing twice the work, for the same amount of output. By braking less often, you end up accelerating less often, getting more miles-per-gallon and saving money (both in gasoline and engine wear). (Obviously, if you’re braking because of a stoplight / stop sign, this doesn’t apply.)

Drive More Safely:

When you're driving aggressively, driving closely to the car in front of you, and focusing on getting where you’re going as quickly as possible, the more likely you are to get in an accident. The amount of space and time you have to make a decision (and execute it) is determined by the amount of space your car has in front of you, and the speed at which you’re traveling. It’s counter-intuitive, but by focusing on braking-and-accelerating as little as possible (and by coasting as much as possible), you end up with a larger buffer in front of you, and you generally enter that buffer at a slower speed.

Get To Your Destination In About The Same Amount of Time:

It’s not fun to be late. And — let’s be honest — you probably aren’t going to stick with a new approach to driving if it compromises your ability to get somewhere on time. But with this approach, you’re reaching each “micro destination” (that spot further down the highway, that exit ramp, that streetlight) only a few seconds behind where you’d be otherwise. In some cases, you'll get there even faster, as you might end up approaching a stoplight while coasting, as it turns green, rather than approaching it, stopping, waiting, and then accelerating again from a stop, while the guy in the lane next to you cruises through at 10 miles an hour.

Have More Fun While Driving:

This approach actually makes driving fun, as the goal shifts away from “getting where I’m going as fast as I can and who do these jerks think they are, getting in my way?!?!” to one of a game mindset, where you’re trying to follow the rules, seeing how far you can go without braking, and seeing how much your fellow drivers have to speed up and slow down while you’re coasting along.

As a side benefit, creating a larger buffer and then eating it up enables the cars behind you to have a smoother trip at a more constant speed, where they aren’t having to brake as much, either, and dissolves the slow-down-then-speed-up-then-slow-down-again rubber-band traffic cycle.