I checked that it works for me in 2010 upon publishing to lists and libraries
Though in Infopath filler/client form it shows the short username from Windows of client machine (in my case Administrator) and in browser form the sharepoint username (in my case i:0#.f|membership|[email protected])
Have you published the template after having set textbox Properties value to 'UserName' using Function button and creating a new template with a new template? Default value will not show up create a form it with an earlier (published) template or edit the earlier saved/submitted form with already saved (for example, blank) value of text box.
You would probably want to set the textbox value with a rule on Form Load (under Data tab in ribbon) instead of default value.