The way to inform the Puppet master about the state of the target system before catalog compilation is via facts. You can create a custom fact that uses whatever logic is appropriate to determine whether the software in question is installed, and then use conditionals based on that fact in your manifests to control whether you declare the Package or not.
But you shouldn't. Bite the bullet: bring your servers under control so that this sort of thing is no longer a concern. It is really bad to install software from source on your production machines. Everything ought to be managed via packages.
If needs be you could adopt a hybrid approach: write a custom fact that identifies when a piece of software of interest is installed from source, and when that's so, tell Puppet to remove it before (re)installing it from a package (e.g. an MSI). The package then does not need to be conditional, which is to your advantage if you ever want to use Puppet to update it or remove it.
John