You can generate a random number, then use conditions to press a specific key based on that number.
E.G.
Set integer [~random] value as random from 1 to 4
Begin Integer Compare : [~random] Equals 1
Press 1 key and hold for 0,01 seconds and release
Else If Integer Compare : [~random] Equals 2
Press 2 key and hold for 0,01 seconds and release
Else If Integer Compare : [~random] Equals 3
Press 3 key and hold for 0,01 seconds and release
Else
Press 4 key and hold for 0,01 seconds and release
End Condition
If you want to use existing commands, you can replace the keypress actions with "Execute Another Command" actions.