1) if they are used offensively, sure, they'll switch to swords
2) to use them properly, without using BI.exe, you need to put them on continous line, with guard mode on, and use them rather defensively to contain enemy charges.
3) since their primary weapon is spear, they can contain frontal charges, and then continue with swords as better close combat weapon vs infantry