I agree, but there needs to be a mostly-automatic mechanism whereby repeated exercise of this discretion affects the law itself, so that you don't create the opposite problem: people getting unjustly maimed by the legal apparatus because a prosecutor decided to use their "discretion", for whatever reason, to enforce an obsolete law which was still on the books even though it's almost never enforced. (Because legislators apparently have better things to do than repeal old laws which aren't affecting hardly anyone.)
A law which consistently goes unenforced should eventually become unenforceable, not remain discretionary. Consider this an application of the estoppel principle: If you choose not to enforce the law in cases A, B, and C, you shouldn't be able to later try to enforce it in case D without showing that there is some substantial difference between D and the first three cases.
Mandatory sunset clauses would be another good idea, along with a requirement that the entire bill, along with any external documents incorporated by reference (e.g. building codes), must be read into the official record with a quorum of the legislature present before it can be passed or renewed.