What problems are you seeing? Do you get any errors?
Attached is an example that uses viMapTrigger (the VISA equivalent) to map Trig In to TTL0. It then waits for a trigger on TTL0 (you would provide an external signal on Trig In).
Looking at your mapping trigger code, nothing really jumps out at me as incorrect. You do not unmap the triggers in this code, and if you run it a second time, you will get an error -11 (for MapTrigtoTrig) saying that this route is already mapped.
What errors or incorrect behavior are you seeing? With that information, we can look closer at your code and track down where the problem is coming from.