js:
var S = E.getSelection();
var M = S.match(new RegExp('^\\[url(?:=([^\\]]*))?]((?:.|[\r\n])*)\\[/url]$')) || ['', '', ''];
var form = [
 {name: 'href', title: 'URL', value: M[1] ? M[1] : M[2], suffix: eDefBrowseButton('/?q=imce', 'attr_href', 'Browse', 'link')},
 {name: 'text', value: M[1] ? M[2] : (M[0] ? '' : S)}
];
eDefTagDialog('a', form, 'Insert/edit link', 'OK', 'bbcUrlProcess');

bbcUrlProcess = function(tag, form) {
  var url = form.elements['attr_href'].value;
  var text = form.elements['attr_text'].value;
  var str = '[url'+ (text ? ('='+ url) : '') +']'+ (text ? text : url) +'[/url]';
  editor.dialog.close();
  if (url) editor.active.replaceSelection(str);
}