I haven't done that exactly, but attached is an EEM Tcl policy I did that watches the DHCP bindings database and sends syslogs when there are changes to the lease database. It could be modified to count the number of active leases instead, then run the clear command. Just count the number of lines in the show ip dhcp bind output, and if the number exceeds your threshold, do:
run_cli [list "clear ip dhcp binding"]