I've posted an article with an example load test plug-in that allows you to specify the maximum number of test iterations for a load test:

http://blogs.msdn.com/billbar/articles/533216.aspx