Hi Jose,
Of course I'm interested in how mechanize might get stuck... but the answer to your question is to set the timeout on the instance of HttpClient in use.
DefaultHttpClient httpClient = new DefaultHttpClient();
HttpParams params = httpClient.getParams();
params.setConnectionTimeout(httpParams, connectionTimeoutMillis);
params.setSoTimeout(httpParams, socketTimeoutMillis);
MechanizeAgent agent = new MechanizeAgent(httpClient);
That constructor argument allows you to control the underlying http communication as needed.
Cheers
John