This isn't the right way to approach this. When you do
, your program will sit and wait for the su command to finish or timeout before going on the next line of code.
The larger question would be why do you want to do "su"? Are you then going to run certain commands as root? You should instead look into using something like the Expect module.