how to link javascript to $scripts_for_layout while in an element.

I am currently working on a application that will be implementing user customizable widgets on each users dashboard. The user is able to add and remove widgets at will. Each widget is contained within its own element and some have JavaScript files with need to be loaded individually.

The current issue I'm having is if i try and link a JavaScript into the $scripts_for_layout using the following code in an element, nothing will happen.

<?php $javascript->link('widgets/blog',false); ?>

After looking around a bit if found a ticket in the cakephp bug tracker that explains why and a commenter even suggested a workaround that can get around this:

<?php echo join("\n\t", $this->__scripts); ?>

I tried using this but it doesn't seem to work. Does anyone know any other workaround for this issue or even have suggestion on how to do this better?