Even though the idea is brilliant, I did not like the way the original was implemented. I came up with this solution while rewriting our company's dialplan in Lua.
So naturally, you will need the pbx_lua interpreter. You also need the music by Rick Astley himself. A preformated .gsm file can be found here. I use pbx_spool for .call files.
extensions.lua:
function rickroll()
app.answer()
app.background("rick")
sleep(math.random(180))
file = io.open("/var/spool/asterisk/outgoing/ric...