NOTE: This is an old answer. The get_ddl() function now supports tasks.
Here's a script that will kind of generate the DDL you're looking for. It's not perfect but it's worked for my use cases thus far.
show tasks like '%';
SELECT concat('CREATE OR REPLACE TASK ',"name", chr(10)
,' warehouse = ', "warehouse", chr(10)
, case when "predecessor" is null then concat(' ,schedule = ''', "schedule",'''', chr(10)) else '' end
,' ,STATEMENT_TIMEOUT_IN_SECONDS = 14400', chr(10)
,' ,comment = ''', "comment",'''', chr(10)
, case when "predecessor" is not null then concat('after ', "predecessor", chr(10)) else '' end
,'as', chr(10)
, "definition",';'
,chr(10),'alter task ',"name",' resume;') as T
FROM TABLE(RESULT_SCAN(LAST_QUERY_ID()));