Cannot convert m4a files to m4b with AppleScript
mp4, m4a, and m4b are alternative filename extensions for the MPEG-4 Part 14 container format. To "convert" an m4a file to m4b, just rename the file. That's what the script you linked to also does.

The option to remember the previous playback position in iTunes is enabled by default for files with an m4b extension but not for files with an m4a extension, but it can just as well be enabled for files with an m4a extension, so they are not any less "bookmarkable". Just check the "Remember playback position" checkbox from the "Options" tab in the information window. (I think old versions of iTunes didn't have that checkbox, which is probably why the script you linked to was originally created.)

iTunes also displays m4b files under audiobooks by default, but an m4a file can be listed as an audiobook by setting "media kind" to "Audiobook" in the "Options" tab of an information window.

Edit: the script below renames the files of the tracks selected in iTunes and changes the bookmarkable and media kind properties.

tell application "iTunes"
    repeat with t in (get selection)
        set bookmarkable of t to true
        set media kind of t to audiobook
        set l to location of t
        tell application "Finder"
            set f to file l
            set name of f to (text 1 thru -2 of (get name of f)) &amp; "b"
        end tell
    end repeat
end tell