Making an AppleScript that holds down a key [duplicate]

Try running your code using the key down & key up features of AppleScript.

code:

tell application "System Events"
    key down option
    delay 5
    key up option
end tell