The following code should do the job. You may need to tweak the kerning values for different fonts. You will also need to set the usingFractionSlash variable to false, if the font you're using doesn't contain the fraction slash character.
Stan C.
-- before running script, select all characters of fraction (and nothing else)
-- script looks for a forward slash, not a fraction slash, in the selection
set usingFractionSlash to true -- if false, keeps regular forward slash
set fractionSlash to character id 8260 -- not all fonts have this character
tell application "Adobe InDesign CS4"
tell (selection)
set {txt, sz} to {contents, point size}
if (count of characters of txt) < 3 then
error "Selection is too small for a fraction."
else if txt does not contain "/" then
error "Selection does not contain a slash."
end if
set x to offset of "/" in txt
-- adjust slash and spacing
if usingFractionSlash then
set character x to fractionSlash
set kerning value of character (x - 1) to -60.0
set kerning value of character x to -60.0
else
set kerning value of character (x - 1) to -100
set kerning value of character x to -80.0
end if
-- adjust numerator
tell characters 1 thru (x - 1)
set point size to sz * 0.55
set baseline shift to sz * 0.3
end tell
-- adjust denominator
tell characters (x + 1) thru -1
set point size to sz * 0.55
end tell
end tell
end tell