If I'm understanding you correctly, the push-start button currently cycles through the sequence ACC, ACC+IG (engine runs), OFF but what you want is ACC, ACC+IG (engine runs), ACC (to a maximum of 40s), off? In that case you don't need to worry about IG at all and just add a time delay to the ACC relay. I wouldn't bother with an MCU, since you're going to have to do level shifting to drive the relays anyway.
In fact, you can already get time-delay relays so those can be an easier and more robust solution than trying to do it with an MCU.