Doping dependence of the vortex-core energy in bilayer films of cuprates