I would do this:
#+BEGIN_SRC emacs-lisp
(defun org-get-named-block-contents (name)
(save-excursion
(goto-char (point-min))
(let ((regexp (org-babel-named-src-block-regexp-for-name name)))
(or (and (looking-at regexp)
(progn (goto-char (match-beginning 1))
(line-beginning-position)))
(ignore-errors (org-next-block 1 nil regexp)))
(org-babel-expand-src-block))))
#+END_SRC
This is basically what org-babel-find-named-block does, with the (org-babel-expand-src-block) return instead of the position. It avoids the double save-excursion.
This is probably faster than any alternative that involves parsing the buffer, especially for large buffers.
John
-----------------------------------
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803