Most of your examples we handle through something like ossec and a monitoring package, but you could theoretically do something like:
require pkg::wget
if (! defined(Package['wget'])) {
exec 'command': {
}
}
... which *should* require the resource 'pkg::wget' to be compiled first, and then test for the package to be defined.
Unfortunately, my personal experience is that while puppet is very good at using conditional logic to generate a catalog, it's not very good at generating a catalog that contains conditional logic.
However, the idea of an "onFailure" meta-parameter intrigues me-- similar to notify, but only triggers the target resource if the source resource fails.