I'm not sure how to do this with KM, but after cobbling pieces together from several sources and futzing around in UI Browser, this seems to work (on my system at least). Place this script in an Execute AppleScript Action. It's clunky and a bit ugly, but it works. The script could definitely be tidier too.
tell application id "com.apple.systempreferences"
reveal anchor "Dictation" of pane id "com.apple.preference.keyboard"
end tell
tell application "System Events"
tell process "System Preferences"
set currentLanguage to value of attribute "AXValue" of pop up button 1 of tab group 1 of window "Keyboard"
if currentLanguage is "English (United States)" then
set newLanguage to "Italian (Italy)"
tell pop up button 1 of tab group 1 of window "Keyboard"
perform action "AXShowMenu"
tell menu 1
click menu item newLanguage
end tell
end tell
else if currentLanguage is "Italian (Italy)" then
set newLanguage to "English (United States)"
tell pop up button 1 of tab group 1 of window "Keyboard"
perform action "AXShowMenu"
tell menu 1
click menu item newLanguage
end tell
end tell
end if
end tell
end tell
quit application "System Preferences"
Sources: