You are not going to see the form open on screen since you are using back-end LotusScript classes. Why not stick with formula language such as @Command([RunAgent]; “your agent name”) or @Command([ToolsRunMacro); “your agent name”) ?
Otherwise, write the code in LotusScript and have it create the doc behind the scenes.
Wehn you run an agent via Lotusscript, as you show in the latter part of your code, that agent runs as back-end Lotusscript. It can’t do user interface stuff like @Command calls. If you absolutely have to invoke this code from Lotusscript, as you imply, you’ll need to re-write the stuff in pure LS using NotesUIDocument and company.