sorry if i misunderstood something.
I have a bunch of similar questions:
are there ways to create new SSS target application programmatically?
are there ways to add user(or user mapping) in SSS programmatically?
Doing what you ask is essentially re-writing the Central Administration functionality. Managing Target Applications cannot be done from a content web application - it requires permissions to the configuration database.
If you want to automate the creation of target applications, I recommend starting with this Secure Store PowerShell script: http://gallery.technet.microsoft.com/scriptcenter/a88f7b6e-9c9e-475f-afd1-c68c4ef3cc4a/