So what I was going for is to do one of two things:

1. Write package version detection logic in the attributes file (or the libraries/definitions?), then this will execute during compile phase and provide an attribute of the currently installed version. 
2. Write package version detection logic in the recipe file, and act on the results in convergence phase when writing templates.

Both would also have to handle the case of package not being installed yet, probably by assuming newer than 3.5.x.

It seems like the package provider, that does all the heavy cross-platform package logic, doesn't currently have a method to report back a given package version.
Might be a good enhancement for Chef itself, or you could look at using an Ohai plugin that reports package version pack, something akin to https://github.com/finnlabs/ohai-system_packages