I don't think cities have a broad discretion not to act on an ordinance especially if the ordinance states that before and after construction any issue with the exposed land must be taken care of. If I file a complaint they should have to follow up on it even to this day. The only discretion they may have is to pursue the violation enforcement as a civil or criminal.
You apppear to be making a common mistake of concluding that because you think that's the way the law ought to be that it is, in fact, how the law actually works. But the reality is that the general rule is that government has no individual duty to others to enforce the law, and that the government has immunity from suit for such claims. Kentucky is no different in this regard. Kentucky Revised Statutes (KRS) section 65.2003 provides immunity to local governnent for certain types of claims against them:
65.2003 Claims disallowed.
Notwithstanding KRS 65.2001, a local government shall not be liable for injuries or losses resulting from:
(1) Any claim by an employee of the local government which is covered by the Kentucky workers' compensation law;
(2) Any claim in connection with the assessment or collection of taxes;
(3) Any claim arising from the exercise of judicial, quasi-judicial, legislative or quasi- legislative authority or others, exercise of judgment or discretion vested in the local government, which shall include by example, but not be limited to:
(a) The adoption or failure to adopt any ordinance, resolution, order, regulation, or rule;
(b) The failure to enforce any law;
(c) The issuance, denial, suspension, revocation of, or failure or refusal to issue, deny, suspend or revoke any permit, license, certificate, approval, order or similar authorization;
(d) The exercise of discretion when in the face of competing demands, the local government determines whether and how to utilize or apply existing resources; or
(e) Failure to make an inspection.
Nothing contained in this subsection shall be construed to exempt a local government from liability for negligence arising out of acts or omissions of its employees in carrying out their ministerial duties.
(bolding added.) Note that paragraph 3(b) immunizes local governments from claims relating the failure to enforce any law.
The Kentucky Supreme Court applied the same rule to a case that arose just prior to the adoption of the above statute. In 1991, the Supreme Court of Kentucky decided a case on the question of whether a city that had failed to enforce its fire safety code could be sued for damages that occurred later when the building was torched and the occupants of the building were injured, with one of them dying from the fire. The Supreme Court held that the city was not liable for that because enforcing the fire code is a quasi-judicial function and the government is not liable in tort for its failure to perform such functions. Specifically, the court stated:
classify as regulatory and quasi-judicial in nature. Legal liability
flowing from the existence of these fire and safety violations rests on
the owner or other person in possession and control of the building. The
duties assigned by the ordinances to the Director and city inspectors
are to find or confirm violations, and to decide what needs to be done,
whether repairs or placarding the building. The judicial nature of these
decisions is underscored by the fact that there are avenues of appeal
from the decision of the Director to a reviewing authority and to the
courts. There is no more legal liability in this situation for the City
than there would be where a judge fails to make a decision or makes a
wrong one. The trial court's decision that the City must respond in tort
in this situation was in error, not because the City enjoys immunity
from tort liability, but because the incompetent performance of
decision-making activity of this nature by a governmental agency is not
the subject of tort liability."
Bolden v. City of Covington, 803 S.W. 2d 577 (Ky 1991).
Like it or not, it seems pretty clear that in Kentucky you cannot sue a local government for failure to enforce a building code ordinance. I don't practice in KY so feel free to run that by a KY attorney. But based on the above, I'm pretty sure the attorney will tell you the same thing.