It seems like you want to track the last text input that had focus before the click. So you'd create a variable, store it on focus and then call focus on that in the button click.
var $lastfocus = $('input:text:eq(0)'); // initialize to first one.
$('input:text').focus(function() {
$lastfocus = $(this);
});
$('#more-commands-button').click(function() {
alert('hello');
$lastfocus.focus();
});