You should be able to import a TAP (without runtime user in it) through the PowerShell custom command-let, Import-OrchestratorAutomationPack. You can use "Get-Help" to get information on how to use this command-let.
Is the script run on a PO server machine? The PowerShell custom snap-in only exists on a PO server machine (not remote console machine)
I assume that $nsapidname is "CorePSSnapin", right?
Does your script report any error?
See if the Import-orchestratorAutomationPack command-let works if you manually run it from the "Cisco Process Orchestrator PowerShell" console. (It's in the Cisco Process Orchestrator folder under the Start menu).