First one is almost correct, the problems I see are:
1º You forgot the quotes in the strings, instead of:
if k == movsteer then
you should do:
if ( k == "movsteer" ) then
And, your "strwh_type" variable is local, which means it won't exist outside that 'if' statement.