I haven't used EEM on the 3K yet. However, I think it has similar support to the 7K, so this should work:
event manager applet ethport override __ethpm_link_flap
event policy-default count 2 time 1000
action 1 cli conf t
action 2 cli int $interface
action 3 cli ip ospf passive-interface
action 4 cli end
You can't use syslog here since you can't parse the message to get the interface. While you could using Python or Tcl to do this, executing scripts out of EEM applets is not officially supported. So this applet should set an interface that flaps twice within 1000 seconds to be an OSPF passive interface.