From everything I've seen, scripting these functions is not directly possible in AppleScript. Well... except for setting the volume, which is part of Standard Additions sax: use set volume output volume x
(where x is 0-100).
It is possible, I think, to construct NSEvents for these keys, but it has to be done through Quartz (Core Graphics) functions. Those are all C functions with no objective-C wrappers, so they can't be called from AppleScriptObj-C. These functions can be called through python — basically we write an AppleScript that uses do shell script
to call python routines to access Quartz — but it's a bit of a PITA.
Media keys are meant to be flexible, doing different things in different apps, and that flexibility is only going to get more fluid as we move into the Touch Bar era. I suggest it may be more effective to script apps directly to control their functions rather than trying to script them indirectly through keystrokes. Every scriptable media app has commands for 'play', 'stop', 'pause', 'resume'; some have specialized commands like 'step forward' or 'step backward'; those that aren't scriptable directly can usually be GUI scripted. If you say what app you are interested in controlling, I can give more specific pointers.