Hi,
If I good understand what you would like to achieve the examples attached to
Software Factories Toolkit (shortly SFT) can be helpful. SFT it is free tool which contains many things (value providers, actions, etc.) which makes development of a Guidance Packages easier. In you case helpfull sample can be: ConditionalExecutingPackage which is located at InstallDirecttory\Clarius Consulting\Software Factories Toolkit\1.0\Samples.zip.
HTH,
Lukasz