<PAGE>   1
                                                                   EXHIBIT 10.56

                        AGREEMENT FOR PURCHASE AND SALE OF SECURITIES


        THIS AGREEMENT FOR PURCHASE AND SALE OF SECURITIES (the "Agreement") is
made and entered into this 24th day of September, 1998, by and between
Merck-Medco Managed Care, LLC, a Delaware limited liability corporation, and
the subsidiaries or affiliates of it identified in the execution block of this
Agreement (collectively "Medco or "Sellers") which entities, together, own
513,345 shares of the Common Stock and 100,000 shares of the Preferred Stock
(as defined below), and COMNET Corporation, a Delaware corporation ("COMNET" or
"Buyer"), regarding the acquisition by Buyer of all of the Common Stock and all
of the Preferred Stock from Merck, and the other transactions described below.

        WHEREAS, Sellers are the sole and exclusive beneficial owners of an
aggregate of One Hundred Thousand (100,000) shares of 6% Convertible Preferred
Stock ($.01 par value) issued by COMNET (the "Preferred Stock"), and Five
Hundred and Thirteen Thousand, Three Hundred and Forty-Five (513,345) shares of
Common Stock ($.50 par value) issued by COMNET (the "Common Stock"); and

        WHEREAS, Sellers wish to sell all of the aforesaid shares of Preferred
Stock and all of the aforesaid shares of Common Stock in accordance with the
terms and conditions set out herein; and

        WHEREAS, COMNET wishes to purchase all of the aforesaid shares of
Preferred Stock and Common Stock, with all such purchases to be made in
accordance with the terms and conditions set out herein.

        NOW THEREFORE, in consideration of the premises and the mutual
promises, representations, warranties and covenants hereinafter set forth, and
other good and valuable consideration, the receipt and sufficiency of which are
hereby acknowledged, Sellers and COMNET intending to be legally bound hereby
agree as follows.


        1.  Purchase of the Preferred Stock and Common Stock.  Sellers hereby
agree to sell, transfer and deliver to COMNET at Closing (defined below) all of
Sellers' right, title and interest in all of the aforesaid shares of Preferred
Stock and all of the aforesaid shares of Common Stock, free and clear of any
and all claims, liens, encumbrances, security interests,



                                      -1-
<PAGE>   2


pledges or any other clouds on title of any nature whatsoever. COMNET hereby
agrees to purchase from Sellers at Closing the aforesaid 100,000 shares of
Preferred Stock and the aforesaid 513,345 shares of Common Stock.

        2.     Purchase Price; Closing.  As the total purchase price for all of
the aforesaid shares of Preferred Stock, all of the aforesaid shares of Common
Stock and in consideration of the other transactions to be consummated
hereunder, COMNET agrees to pay Medco the following at Closing:

        a)     Six Hundred and Seventy-Five Thousand Dollars ($675,000) for all
of the aforesaid shares of Preferred Stock; plus

        b)     Three Million, Four Hundred and Sixty-Five Thousand,
Seventy-Eight Dollars and Seventy-Five Cents ($3,465,078.75) for all of the
aforesaid shares of Common Stock.

        c)     Payment to be made pursuant to Sections 2(a) and (b), above,
shall be made by Federal wire transfer in accordance with written instructions
provided by Merck.  Payment in full shall be made at Closing - as soon as
possible but no later than October 1, 1998.

        d)     At Closing, Sellers shall deliver to COMNET the certificates
evidencing their ownership of all of the aforesaid shares of Common Stock and
Preferred Stock.

        3.     Financial Condition.  COMNET hereby represents and warrants to
Medco that it has sufficient financial capacity to make at Closing the payment
to Sellers required under Section 2.

        4.     Disclosures by COMNET.

        a)     In connection with the sale to COMNET by Medco of COMNET stock,
COMNET hereby discloses to Medco the information set out in Exhibit 3.1,
hereto.  Such disclosure includes all of the material, non-public information
regarding business opportunities, contingent liabilities and the general
financial condition of COMNET and Group 1, COMNET's 81%, publicly-held
subsidiary.

        b)     All of the disclosed information set out in Exhibit 3.1 is
provided to Medco solely in connection with Medco's sale to COMNET of the
aforesaid Common and Preferred Stock.


                                      -2-
<PAGE>   3

        c)     Because the securities issued by COMNET and Group 1 are traded
on Nasdaq, National Market System, Medco hereby agrees that use or
dissemination by it of non-public, material information about COMNET or Group 1
in connection with any purchase or sale of securities of COMNET or Group 1
(except for sales to COMNET) could violate federal securities laws.
Accordingly, Medco hereby agrees that all of the information set out in Exhibit
3.1, hereto, shall be maintained by Medco in strict confidence and that any
disclosure of any of this information by Medco to anyone else shall be done
only upon the prior written consent of the General Counsel of COMNET or his
express designee.  Medco further agrees that until the information set out in
Exhibit 3.1, hereto, is made public, Medco may not participate in any sale or
purchase of any security issued by COMNET or Group 1 (except for sales to
COMNET) without the express written consent of the General Counsel of COMNET or
Group 1, respectively, or his express designee.

        d)    Medco agrees that it has read and understands the information
set out in Exhibit 3.1, hereto, that the identities of any third parties
referenced therein but not identified therein has been separately disclosed to
them and that it has been given any further information it has requested
regarding the matters disclosed therein.

        e)     Medco agrees that it has read the public information provided by
COMNET (including the Form 10-K Annual Reports for COMNET's fiscal years ended
March 31, 1998, 1997 and 1996, Form 10-Q Quarterly Report for the Quarter Ended
June 30, 1998 and the Joint Proxy/Registration Statement of COMNET and Group 1
dated August 6, 1998) and such other information disclosed by COMNET to Medco
in connection with this transaction, it understands the information set out in
such reports and disclosures.

        f)     Sellers agree that COMNET has answered all inquiries that it has
made concerning COMNET, its business and financial condition or any other
matter relating to the operation of COMNET and the offer and sale of Common
Stock and Preferred Stock hereunder. No oral or written statement or inducement
that is contrary to the information disclosed to Sellers has been made by or on
behalf of COMNET.


                                      -3-
<PAGE>   4

        5.     Medco's Authority, Status and Other Representations and
               Warranties.

        a)     Sellers, jointly and severally, warrant and represent to Buyer
that all of the aforesaid shares of the Common Stock and Preferred Stock are
owned beneficially and of record solely and exclusively by Sellers; that there
are no options, warrants, rights, liens, encumbrances, commitments or other
clouds on title with respect to any of the shares of the aforesaid shares of
Common Stock or Preferred Stock.

        b)     Sellers, jointly and severally, represent and warrant to Buyer
that each of Sellers is a corporation in good standing under the laws of the
State of Delaware.  Sellers, jointly and severally, each warrant and represent
to Buyer that at all times material hereto, each Seller has had and shall have
the capacity and authority to execute and deliver this Agreement, to perform
hereunder, and to consummate the transactions contemplated hereby without the
necessity of any act or consent of any other person whomsoever; that the
execution, delivery and performance by each under this Agreement and each and
every agreement, document and instrument applicable to it, made in connection
herewith shall be duly authorized and approved by the necessary corporate
authority; that this Agreement and each and every agreement, document and
instrument to be executed, delivered and performed by Sellers in connection
herewith, will, when executed and delivered, constitute the valid and legally
binding respective obligations of Sellers, except as enforceability may be
limited by applicable equitable principles or judicial discretion, or by
bankruptcy, insolvency, reorganization, moratorium, or similar laws from time
to time in effect affecting the enforcement of creditors' rights generally.

        c)     Sellers, jointly and severally, represent and warrant to Buyer
that there are no authorizations, consents, approvals, licenses, exemptions
from or filings with, or registrations with any governmental,
quasi-governmental or non-governmental regulatory agency or authority,
necessary on its part for, or in connection with, the transactions contemplated
hereunder, except for SEC Form 5 and an amendment to SEC Form 13(d) that shall
be filed by Medco in connection with the sale of the aforesaid shares of Common
and Preferred Stock.

        d)     Sellers, jointly and severally, represent and warrant to Buyer
that the execution and delivery of this Agreement by each does not, and the
consummation of the transactions


                                      -4-
<PAGE>   5

contemplated hereby will not, violate any provisions of the Certificate of
Incorporation, as amended, or Bylaws, as amended, of any Seller.

         e)     Sellers, jointly and severally, represent and warrant to Buyer,
that there is no action, proceeding, investigation, regulation or legislation
instituted, threatened or proposed before any court, governmental agency or
legislative body to enjoin, restrain, prohibit, or obtain substantial damages
in respect of, or related to, or arising out of, this Agreement or the
consummation of the transactions contemplated hereby, which action, proceeding,
investigation, regulation or legislation, in the reasonable judgment of Sellers
would make it inadvisable to consummate such transactions.

        f)     Sellers, jointly and severally, represent and warrant to Buyer
that Sellers' entry into and performance under this Agreement shall not result
in any violation of any statute, law, ordinance, regulation, rule, judgment,
decree or order of any governmental agency to which any of Sellers is subject.

        g)      Sellers, jointly and severally, represent and warrant to Buyer
that Sellers' entry into and performance under this Agreement shall not result
in any default, breach or other violation of any loan or credit agreement,
note, bond, mortgage, indenture or other agreement, permit, concession, contact
or other instrument to which Sellers are subject.

        6.     COMNET's Authority and Status.

        a)     COMNET represents and warrants to Sellers that it is a
corporation in good standing under the laws of the State of Delaware and it has
the capacity and authority to execute and deliver this Agreement, to perform
hereunder and to consummate the transactions contemplated hereby without the
necessity of any act or consent of any other person whomsoever.  The execution,
delivery and performance by COMNET of this Agreement and each and every
agreement, document and instrument provided for herein have been duly
authorized and approved by its Board of Directors.  This Agreement, and each
and every other agreement, document and instrument to be executed, delivered
and performed by COMNET in connection herewith, constitutes or will, when
executed and delivered, constitute the valid and legally binding obligation of
COMNET, enforceable against COMNET in accordance with their respective terms,
except as enforceability may be limited by applicable equitable principles or
judicial discretion, or by bankruptcy, insolvency, reorganization,



                                      -5-
<PAGE>   6

moratorium, or similar laws from time to time in effect affecting the
enforcement of creditors' rights generally.

        b)     COMNET represents and warrants to Sellers that the execution and
delivery of this Agreement by it does not, and the consummation of the
transactions contemplated hereby will not, violate any provisions of the
Certificate of Incorporation, as amended, or Bylaws, as amended, of COMNET.

        c)     COMNET represents and warrants to Sellers that there is no
action, proceeding, investigation, regulation or legislation instituted,
threatened or proposed before any court, governmental agency or legislative
body to enjoin, restrain, prohibit, or obtain substantial damages in respect
of, or related to, or arising out of, this Agreement or the consummation of the
transactions contemplated hereby, which action, proceeding, investigation,
regulation or legislation, in the reasonable judgment of COMNET would make it
inadvisable to consummate such transactions.

        d)      COMNET represents and warrants to Sellers that COMNET's entry
into and performance under this Agreement shall not result in any violation of
any statute, law, ordinance, regulation, rule judgment, decree or order of any
governmental agency to which COMNET is subject.

        e)      COMNET represents and warrants to Sellers that COMNET's entry
into and performance under this Agreement shall not result in any default,
breach or other violation of any loan or credit agreement, note, bond,
mortgage, indenture or other agreement, permit, concession, contact or other
instrument to which COMNET is or may be subject.

        f)     Buyer represents and warrants to Seller that there are no
authorizations, consents, approvals, licenses, exemptions from or filings with,
or registrations with any governmental, quasi-governmental or non-governmental
regulatory agency or authority, necessary on its part for, or in connection
with, the transactions contemplated hereunder.

        7.     Further Representations.  COMNET hereby represents and warrants
to Medco that COMNET knows of no claim, demand or cause of action that has been
made, or to COMNET's best knowledge (after diligent inquiry) may be made, by
COMNET against Medco or any of the Sellers with respect to Sellers' ownership
of the Common Stock or the Preferred Stock. Sellers hereby represent and
warrant to COMNET that Sellers know of no claim, demand or



                                      -6-
<PAGE>   7

cause of action that has been made, or to Sellers' best knowledge (after
diligent inquiry) may be made, by Sellers against COMNET with respect to
Sellers' ownership of the Common Stock or the Preferred Stock.

        8.     Mutual Indemnification.

        a)     Medco and COMNET each agrees to indemnify, defend and hold
harmless the other and their respective current and past officers, directors,
employees, agents and representatives from all losses, damages, liabilities,
costs (including reasonable attorneys' and experts' fees) and expenses
(collectively, the "Losses") incurred by the party being indemnified arising
out of any material breach of any representation, warrantee, covenant or
agreement, made by the indemnifying party in this Agreement

        b)     The indemnified party shall have the right to approve the
selection of any counsel selected by the indemnifying party to defend
hereunder, which approval shall not be unreasonably conditioned, delayed or
denied.  The indemnifying party shall not enter into any settlement with
respect to the matters indemnified hereunder which may adversely affect any
interest of the indemnified party without first obtaining the written consent
of the indemnified party, which consent shall not be unreasonably conditioned,
delayed or denied. The indemnifying party agrees to reimburse the indemnified
party promptly for all such Losses as they are incurred by the indemnified
party; provided, however, that with respect to any expenses reimbursed to the
indemnified party in advance of the final disposition of any such proceeding
covered by this indemnification, the indemnified party shall have delivered to
the indemnifying party an undertaking to repay to the indemnifying party the
amounts so advanced if it shall ultimately be determined that the indemnified
party is not entitled to be indemnified hereunder.

        9.     Payment of Fees and Expenses.  Medco and COMNET each agrees that
regardless of whether the transactions contemplated hereunder close, to pay its
own fees and expenses, including the fees and expenses of its respective
counsel, accountants, brokers, advisors, employees and other agents, if any,
incurred in connection with the transactions contemplated here, unless
expressly agreed to otherwise in the Agreement.

        10.    Notices.  All notices, requests, demands and other
communications hereunder shall be in writing and shall be delivered by hand or
mailed by registered or certified mail,


                                      -7-
<PAGE>   8

return receipt requested, first class postage prepaid, addressed or telefax as
follows:

        a)     If to Medco:

               One Merck Drive
               Whitehouse Station, N.J. 08889-0100
               Attention:  General Counsel
               Telefax: (908) 735-1244

               If to COMNET:

               4200 Parliament Place
               Suite 600
               Lanham, Maryland  20706-1488
               Attention:  Mark D. Funston
               Chief Financial Officer
               Telefax: (301) 918-0430

        b)     If delivered personally or by telefax, the date on which a
notice, request, instruction or document is delivered shall be the date on
which such delivery is made and, if delivered by mail, the date on which such
notice, request, instruction or document is received shall be the date of
delivery.

        c)     Any party hereto may change its address specified for notices
herein by designating a new address by notice in accordance with this Section
10.

        11.    Brokers.  COMNET and Medco each represents and warrants to the
others that no broker or finder has acted for it or any entity controlling,
controlled by or under common control with it in connection with the
transactions described in this Agreement.

        12.    Further Assurances. COMNET and Medco each covenants to the
others that at no additional expense to the others, at any time, and from time
to time each shall execute and deliver (or cause to be so done) such additional
instruments and take such actions as may be reasonably requested by the
other(s) to confirm or perfect or otherwise to carry out the intent and
purposes of this Agreement.

        13.    No Third Party Beneficiaries.  Nothing contained herein shall be
construed to afford any rights or benefits to any person or entity other than
Medco or COMNET. Any



                                      -8-
<PAGE>   9

implication of rights granted to any third party is hereby expressly
disclaimed.

        14.    Miscellaneous.

        a)     This Agreement shall be binding upon and inure to the benefit of
the parties hereto and their respective and permitted successors and assigns.
No delegation, transfer or assignment of any rights or obligations under this
Agreement is permitted and any attempted transfer or assignment shall be void,
except as follows in this Section 14(a). The rights, title, responsibilities,
interests and remedies hereunder of COMNET and Medco are freely assignable by
them to any entity which purchases or succeeds to all or substantially all of
the assets or capital stock of such entity either through asset acquisition,
stock sale or merger (wherein the party hereto is not the surviving entity).

        b)     The section and other headings in this Agreement are inserted
solely as a matter of convenience and for reference, and are not a part of this
Agreement.

        c)     This Agreement together with the documents executed concurrently
herewith constitute the entire agreement among the parties hereto with respect
to the transactions contemplated hereby and supersedes and cancels any prior
agreements representations, warranties, or communications, whether oral or
written, among the parties hereto relating to the transactions contemplated
hereby.

        d)     This Agreement shall be governed by and enforced in accordance
with the laws of the State of Delaware, principles of conflicts of law
notwithstanding.

        e)     Any failure on the part of any party hereto to comply with any
of its obligations, agreements or conditions hereunder may be waived by any
other party to whom such compliance is owed.  No waiver of any provision of
this Agreement shall be deemed, or shall constitute, a waiver of any other
provision, whether or not similar, nor shall any waiver constitute a continuing
waiver.  Neither this Agreement nor any provision hereof may be changed,
waived, discharged or terminated orally, but only by an agreement in writing
signed by the party against whom or which the enforcement of such change,
waiver, discharge or termination is sought.



                                      -9-
<PAGE>   10

        f)     This Agreement may be executed in counterparts, each of which
shall be deemed an original, but all of which together shall constitute one and
the same instrument.

        g)     All pronouns used herein shall be deemed to refer to the
masculine, feminine or neuter gender as the context requires.  References
herein to the plural shall include the singular, or vice versa, as context
requires.

        h)     In the event that any provision of this Agreement or any word,
phrase, clause, sentence or other portion thereof shall be held to be
unenforceable or invalid for any reason, such provision or portion thereof
shall be modified or deleted in such a manner so as to effect the agreement of
the parties under this Agreement, as modified, to the fullest extent permitted
under law.

        i)     In the event any dispute arises under or related to any of the
provisions set out in this Agreement, the parties hereto agree to submit any
and all such disputes binding arbitration pursuant to the then current
Commercial Rules of the American Arbitration Association and that the decision
by the AAA shall be binding upon them, enforceable by any Court of competent
jurisdiction.

        IN WITNESS WHEREOF, each party hereto has executed or caused this
Agreement to be executed on its behalf, all on the day and year first above
written.

                                Merck-Medco Managed Care, LLC, a Delaware
                                corporation (successor to
                                Containment Services, Inc.)


                                By: /s/ J.T. WEINSTEIN
                                    -------------------------

                                Its:
                                     ------------------------


                                MCCO Corp. (successor to Medco Data Collection),
                                a Delaware corporation


                                By: /s/ ROBERT S. MCGOVERN
                                    -------------------------

                                Its:
                                     ------------------------


                                      -10-
<PAGE>   11

                                COMNET Corporation, a Delaware corporation


                                By: /s/ ROBERT S. BOWEN
                                    -------------------------

                                Its: CHIEF EXECUTIVE OFFICER
                                     ------------------------




                                      -11-