If using the IVI driver, it has the driver.System.DirectIO.WriteString() for sending commands directly to the instrument.
Using the loadscript/endscript constructs, you can load your functions into runtime memory of instrument.
Of course you can read the tsp file line by line and write the line to the instrument to load functions defined in TSP file that you write/validate in Test Script Builder.
// load a very simple script that defines a funtion that has two parameters
myInstr.WriteString("loadscript mysciptname");
myInstr.WriteString("function myfunction(freq, duration)");
myInstr.WriteString("beeper.beep(duration, freq)");
myInstr.WriteString("end");
myInstr.WriteString("endscript");
myInstr.WriteString("mysciptname.run()"); // run the script
// now call the loaded function to cause 1 second 1200Hz tone from 26xx
myInstr.WriteString("myfunction(1200, 1)");
//myInstr.WriteString("myfunction(800, 5)");