Sure it could probably evolve resistance, it would just take much more time, and in an environment that constantly maintains a reasonable amount of selection pressure, increasing it as they evolve. Humans could assist the process by "island hopping". Like trying to select for ones that produce a certain chemical, then another chemical that requires that, step by step. As opposed to hoping they get a mutation that lets them produce a complex chemical by random chance.
It would still take a while, but bacteria have very short generations and can support huge populations, so it's far, far easier for them to evolve than anything else.
What you are suggesting seems awefully hard to do though. Its pobably easier to just get a ready-made gene from some other bacteria and insert it into the bacteria you care about.
It would still take a while, but bacteria have very short generations and can support huge populations, so it's far, far easier for them to evolve than anything else.