Revit will only allow programmatically creating parameters from an external definition, not an internal one. This means that unless there is a user action, all parameters are shared parameters which means no key schedule parameters. This has been the case for awhile now, and as far as I know continues to be this way.
You may be able to create what you need though other methods though. Look into the key schedule nodes in the Archi-lab package.
Ah, shucks - thought Lonrad May have had some black magic. Least it is a one time thing to create (you can transfer the key schedule view next time which brings the parameters with it).