What you are doing seems to be reproducing what wp_link_pages()
does:
Displays page-links for paginated posts (i.e. includes the
Quicktag one or more times). This works in much the
same way as link_pages() (deprecated), the difference being that
arguments are given in query string format. This tag must be within
The_Loop.
Using one or more of the provided arguments…
$defaults = array(
'before' => '<p>' . __( 'Pages:' ),
'after' => '</p>',
'link_before' => '',
'link_after' => '',
'next_or_number' => 'number',
'separator' => ' ',
'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ),
'pagelink' => '%',
'echo' => 1
);
… you should be able to get pretty close to that markup.
In particular, I believe this will do it (untested):
$defaults = array(
'before' => '<div class="pagination">',
'after' => '</div>',
'nextpagelink' => __( 'Next page' ),
'previouspagelink' => __( 'Previous page' ),
);