You can do this without using SPSS Scripts:
http://www-01.ibm.com/support/docview.wss?uid=swg21488223Here is a demo:
get file="C:\Program Files\IBM\SPSS\Statistics\22\Samples\English\Employee data.sav".
freq jobcat.
SPSSINC MODIFY TABLES subtype="Frequencies"
SELECT=0
PROCESS=ALL
/STYLES CUSTOMFUNCTION="customstylefunctions.transpose".