in reply to A way to break if an action is not responding and go to next?

In your stopsmc() function you are calling system. On Microsoft Windows only, system has an additional feature. It has an optional first parameter which, if non-zero, runs the job asynchronously in the background - a bit like appending '&' to a command on UNIX. For example:
my $pid = system(1, 'background.exe');
In this case system returns the process id of the child. This is documented in perlport - probably not the first place you would look for it!

You have a function called timedelay() and you don't say why you need that. Maybe that could be utilised as a timeout?