Like Nate posted, the only way to universally determine MPG via OBDII is to use the MAF sensor (or convert to MAF via the MAP & IAT sensors). The equations are posted earlier in this thread.
Fuel injector pulsewidth is not a standard OBD-II PID...
Great work guys. I wish I could contribute code as this is a project I really want to see hit fruition.
- LostCause