フレーム内マージン+フォントサイズに下線を設定します。
スクリプト実行後下線の色を好みに変えてください。
tell document 1 of application “Adobe InDesign CS5”
set a2 to baseline of selection
set a1 to parent text frames of selection
copy geometric bounds of a1’s item 1 to {b1, b2, b3, b4}
set c1 to fill color of a1’s item 1
set h1 to b3 – b1
set o1 to b1 – a2 + (h1 / 2)
set properties of selection to {underline weight:h1, underline color:c1, underline:true, underline offset:o1}
end tell