Seriously OP, just get a door lock. By all means start teaching road safety too, but ignore the above, I urge you. Smacking and threatening will not work. To be blunt, do you want to be explaining to police that the reason your kids were on the road was because the door wasn't adequate and saying "But I did smack them and threaten to give them ten more?!"
You have a responsibility to provide a safe environment. Get the chain lock and the baby gate, it will do wonders for your peace of mind and keep your babies safe